Project - Data Handling and Interpolation
%the given data is read into matlab using xlsread function
File=xlsread('C:\Users\Manu Mathai\Downloads\VI.xlsx');
%Voltage and current is assigned to V & I respectively
V=File(:,1);
I=File(:,2);
%interpolation range is established in Vint
Vint=[-17.3:0.1:0.9];
%interpolation of the data is carried out using interp1
Iint=interp1(V,I,Vint,'pchip');
%VI matrix is created with Vint and Iint
VI=[Vint;Iint];
%Voltage is ploted againt the Current
plot(V,I,'g*')
hold on
plot(Vint,Iint,'r--')
legend('Input data','Interpolation data','Location','best')
xlabel('Voltage [v]')
ylabel('Current [Amps]')
title('Voltage Vs Current');
%Interpolated value matrix is stored into text file and excel file
writematrix(VI,'C:\Users\Manu Mathai\Downloads\VI_project.xlsx')
writematrix(VI,'C:\Users\Manu Mathai\Downloads\VI.txt','Delimiter','tab')
