Project - Data Handling and Interpolation
xlsread('C:\Users\Lenovo\Desktop\Vl.xlsx');
v = (-17.3,-17.1,-17,-16.8,-16.5,-16,-15,-14,-12,-10,-8,-5,-2,-0.2,0.09,0.19,0.27,0.39,0.43,0.5,0.55,0.6,0.62,0.65);
I = (-28,-24,-19,-14,-9,-6,-4,-3,-2,-1.3,-1,-0.6,-0.3,-0.1,0,0,0,0.01,0.03,0.17,0.42,1.23,1.99,3.91)
% The above values are obtained from the excel;
% to get the I value for the above required V values
I1 = interp1(v,I,-17.2);
I2 = interp1(v,I,-17.1);
I3 = interp1(v,I,-13.8);
I4 = interp1(v,I,-13.5);
I5 = interp1(v,I,-13.0);
I6 = interp1(v,I,-12.5);
I7 = interp1(v,I,-11);
I8 = interp1(v,I,-9);
I9 = interp1(v,I,-5.76);
I10 = interp1(v,I,-6);
I11= interp1(v,I,-1);
I12= interp1(v,I,0.11);
I13= interp1(v,I,0.25);
I14= interp1(v,I,0.5);
I15= interp1(v,I,0.61);
Z =(I1:I15);
plot(v,I,Z); %plotting
xlabel ('voltage V');
ylabel ('Current A');
%To write to a txt file
fileid=fopen('C:\Users\Lenovo\Desktop\V_vs_I.txt','w');
fprintf(fileid,'%d',Z);
End;