Project - Data Handling and Interpolation
PROJECT:
%excel_reader.m
A=xlsread('VI.xlsx'); %Read excel file
V=A(:,1); %Voltage
I=A(:,2); %Current
x=[-17.3:0.1:0.9]; %time intervals
z=interp1(V,I,x); %interpolating x with V,I
plot(x,z) %poltting curve
x1=[-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]; %time intervals
z1=interp1(V,I,x1); %interpolating x1 with V,I
%Write to text file
%reader.txt
fileId=fopen('reader.txt','w'); %open the file
fprintf(fileId,'%d''%f',z1); %printing the file
fclose(fileId); %close the file
RESULT:
-2.600000e+01'-24.000000-2.900000e+00'-2.750000-2.500000e+00'-2.250000-1.650000e+00'-1.150000-7.013333e-01'-0.733333-1.888889e-01'0.0000000'0.1700001.610000e+00'