Project - Data Handling and Interpolation
data = xlsread('VI.xlsx'); %read date from xlsc sheet
v = data(:,1); %takeing voltage value from data
i = data(:,2); %takeing curret value from data
x = (-17.3:0.1:0.9); % range
in = interp1(v,i,x,'spline'); % interpolation
figure (1)
plot(x,in,'m--',v,i,'o');
vv = [-17.2 -17.1 -13.8 -13.5 -13.0 -12.5 -11 -9 -5.76 -6 -1 0.11 0.25 0.5 0.61]; % value
in2 = interp1(v,i,vv,'spline'); % interpolation
figure (2)
plot(vv,in2,'m--',v,i,'o');
fid = fopen('inter_currentvalue.txt','w'); %create file
fprintf(fid,'%d\n',in2); % inserting in file