Project - Data Handling and Interpolation
PROJECT
INTERPOLATION
close all
clc
X=xlsread('VI.xlsx');
(In here we have read the Excel file into the Matlab)
V=X(:,1)
I=X(:,2)
(Defined both voltage and current variables in the excel file into the matlab)
xs=[-17.3:0.1:0.9]; ( Range of the interpolation)
Z1=interp1(V,I,xs) (Normal interpolation function for giving more clarity to the points in between the co ordinates)
Z2=interp1(V,I,xs,'spline') ( Spline interpolation for more specifying)
figure(1)
plot(V,I,'-',xs,Z1,'o')
figure(2)
plot(V,I,'-',xs,Z2,'o')
xlabel('Voltage')
ylabel('Current')
title('V vs I')
grid on
hold on
file=fopen('VI.txt','w')
fprintf(file,'%16s %16s\n',Z)
fclose(file);
we have saved this file into the system as VI in text format
RESULTS
(a)Normal Interpolation

(b)Spline interpolation
