Project - Data Handling and Interpolation
Project:
% The project describes the perform the interpolation
matrix=xlsread('VI.xlsx'); % Read the values from Excel VV.xlsx
Voltage=xlsread('VI.xlsx','A:A'); % Read the values in the Column A from excel and stores it into Voltage variable
Current=xlsread('VI.xlsx','B:B'); % Read the values in the Column B from excel and stores it into Current variable
INTPOL=[-17.3:0.1:0.9]; % Interpolation range =17.3 to 0.9
OUT=interp1(Voltage,Current,INTPOL); % Linear interpolation
OUTS=interp1(Voltage,Current,INTPOL,'spline'); % Spline interpolation
figure(1);
plot(Voltage,Current,'ob',INTPOL,OUT,INTPOL,OUTS,':g'); % Plot the variables of voltage and current
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];
fid= fopen('Voltage_Current.txt','w'); % Create the text file 'Voltage_Current.txt'
L=length(VV); % Find the length of VV Vector variable
for i=1:L
fprintf(fid,'%d\t',VV(i)); % Write the VV Variable in text file
DATA = interp1(INTPOL,OUTS,VV(i));
fprintf(fid,'%d\n',DATA); % Write the respective data of VV Variable in text file
i=i+1;
end
% END

FIGURE:
