Project - Data Handling and Interpolation
Aim :
y=interp1(V,I,x,'spline');

Commands:
clc
clear all;
%% using this command the excel file read
file=xlsread('VI.xlsx')
%% the data format is kept compact form
format compact;
%% first column is read
V=file(:,1)
%% second column is read
I=file(:,2)
x=-17.3:0.1:0.9;
y=interp1(V,I,x,'spline');
subplot(211);
plot(V,I,'o',x,y)
grid on
title('voltage vs current')
xlabel('voltage')
ylabel('current')
grid on
%%
VV=[-17.2
-17.1
-13.8
-13.5
-13
-12.5
-11
-9
-5.76
-6
-1
0.11
0.25
0.5
0.61]
II=interp1(V,I,VV)
z=[VV II]
fileID = fopen('VI.xlsx','w')
fprintf(fileID,'%6s %12s\n','VV','II');
fprintf(fileID,'%6.2f %12.8f\n',z);
fclose(fileID)
