Project - Data Handling and Interpolation
ans)
a=xlsread('VI.xlsx'); % for reading the xls file
I=a(:,1)'; %assigned first column to a variable
V=a(:,2)'; % assigned second column to an another variable
Iq=[-17.3:0.1:0.9]; % given new interval to a variable
Vq1=interp1(I,V,Iq); % for normal interpolation
Vq2=interp1(I,V,Iq,'spline'); % for getting a smooth graph
figure(1); % first figure
plot(I,V,'O',Iq,Vq1,':.'); % ploting linear interpolation
grid;
title('linear interpolation'); % for giving title
xlabel('voltage');ylabel('current');% for labeling
figure(2);
plot(I,V,'O',Iq,Vq2,':.');
grid;
title('spline interpolation'); % for spline interpolation
xlabel('voltage');ylabel('current');
c=(Iq)';
v=(Vq2)';
s=[c,v]; % made the Iq values and Vq2 values in to a single matrix
writematrix(s,'missing data.txt'); % for writing into a txt file