Project - Data Handling and Interpolation
num=xlsread('VI.xlsx');
V=num(:,1);
I=num(:,2);
t= -17.3:0.1:0.9;
y1=interp1(V,I,t);
hold on
subplot(221);
plot(V,I,'r*',t,y1,'b*')
xlabel('voltage');
ylabel('current');
grid on
title('interpolation');
y2=interp1(V,I,t,'spline');
subplot(222);
plot(V,I,'r*',t,y2,'b*');
xlabel('voltage');
ylabel('current');
grid on
title('interpolation');
fileid=fopen('Volt_Cur.txt','w');
fprintf(fileid, '%d, %f\n',y1,y2);
fclose(fileid);