Project - Data Handling and Interpolation
p=readtable('VI.xlsx');%Read excel file
data=p.Variables;% extract data excel file
v=data(:,1);%extract V_Volt_ data from excel file
i=data(:,2);%extract I_mAmp_ data from excel file
v1= (-17.3:0.1:0.9);%interpolation range
i1=interp1(v,i,v1);%interpolation method 1
i2=interp1(v,i,v1,'spline');%interpolation method 2
figure(1);%open figure
plot(v,i,'b',v1,i1,'o')%normal plot vs interpolation method 1
grid
title('linear interpolation')%plot titel
figure(2);%open figure
plot(v,i,'b',v1,i2,'g--')%normal plot vs interpolation method 2
grid
title('spline interpolation')%plot titel
%session for wirte missing data in missing_data.txt file
filename=fopen('missing_data.txt','w'); %open text file name missing _ata.txt 'w' specifies providing write access
fprintf(filename,'%d \n',i1); %formats data and displays the results of missing_data.txt file on the screen
%(%d for specify data type and \d for space betwin data)
fclose(filename); %closes an open file missing_data.txt


