Project - Data Handling and Interpolation
%Project - Data Handling and Interpolation
%Reading excel file & storing it to variable
Input_data=xlsread('VI.xlsx');
%Assigning different columns to diff. variables
V=Input_data(:,1);
I=Input_data(:,2);
vq=-17.3:0.1:0.9;
%Creating interpolation using interp1 fn
iq=interp1(V,I,vq,'spline');
%Graph ploting & labeling
plot(V,I,'ro',vq,iq,'b','LineWidth',2);grid;hold;
xlabel('Voltage\rightarrow'); ylabel('Current\rightarrow');
legend('Given data', 'Interpolated data');
title('Project-Interpolation & File Handeling');
%Saving interpolated data to txt file
fid=fopen('Interpolated_values.txt','w');
z=[vq;iq];
fprintf(fid,'%f %f\n',z);
Ans-
