Project - Data Handling and Interpolation
P=xlsread('VI.xlsx');%read excel spreadsheet
v=P(:,1);%assigning voltage from VI.xlsx
i=P(:,2);%assigning current from VI.xlsx
vq=[-17.3:0.1:0.9];%range for interpolate the data
iq=interp1(v,i,vq,'spline');%interp1 for interpolate the data in spline
plot(v,i,'o',vq,iq,':.');
grid
title('data interpolation');
file_data_vi=fopen('vidata.txt','w');%open the vidata.txt for writing
fprintf(file_data_vi,'%8s\n','V(volt)');%printing the v(volts) inside the text above the vq values
fprintf(file_data_vi,'%f\n',vq);%printing the v(volts) inside the text
fprintf(file_data_vi,'\n\n%8s\n','i(amps)');%printing the i(amps) inside the text above the iq values
fprintf(file_data_vi,'%f\n',iq);%printing the i(amps) inside the text
fclose(file_data_vi);%close the file