Project - Data Handling and Interpolation
load('project.mat') %load the excel data from previous matlab sheet
xq = (-17.3:0.1:0.9); %define the range
vq = interpn(x,v,xq,'spline'); %use intern for the output
figure
plot(x,v,'o',xq,vq,'-'); %plot for spline interpolation
title('spline interpolation');
xlabel('Voltage [V]');
ylabel('Current [I]');
legend('actual data','Interpolation data'); %labeling on plot
grid on; %keep the grid
fileID = fopen('interpolated_output.txt','w'); %to write the interpolated data
fprintf(fileID,'%d\t',vq); %print the value
fclose(fileID);
print('interpolation','-dpng')