Project - Data Handling and Interpolation
Project :
Aim:
To read the Excel file in Matlab Program and perform the interpolation in the given range -17.3:0.1:0.9. and store them in the text file.
Matlab code:
clc
clear all
file=xlsread('VI.xlsx'); %To read the excel file
format compact;
V=file(:,1); %for columns
I=file(:,2); %for Rows
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.3
-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('VVII.txt','w');
fprintf(fileID,'%6s%12s\n','VV','II');
fprintf(fileID,'%6.2f%12.8f\n',z);
fclose(fileID);



Result:
The Excel file is read in Matlab Program and performs the interpolation in the given range -17.3:0.1:0.9. and store them in the text file.