Project - Data Handling and Interpolation
Ans 1
x=[-17.3,-17.1,-17,-16.8,-16.5,-16,-15,-14,-12,-10,-8,-5,-2,-0.2,0.09,0.19,0.27,0.39,0.43,0.5,0.55,0.6,0.62,0.65]; %defining data set for voltage
y=[-28 ,-24,-19,-14,-9,-6,-4,-3,-2,-1.3,-1,-0.6,-0.3,-0.1,0,0,0,0.01,0.03,0.17,0.42,1.23,1.99,3.91]; %data set for current in mAmp
xq=-17.3:0.1:0.09; %defining data range
volt1=interp1(x,y,xq); % linear interpolation
volt2=interp1(x,y,xq,'spline'); % spline interpolation
figure(1); %command for plotting figure as figure(1)
plot(x,y,'o',xq,volt1,':'); %defining t0 plot for x ,y and volt1 values in linear interpolation
grid; %command for showing the grid
title('Linear interpolation'); %naming it as linear interpolation
figure(2); %command for plotting figute as figure (2)
plot(x,y,xq,volt2); %defining t0 plot for x,y and volt2 values in spline interpolation
grid; %command for showing the grid
title('spline interpolation'); %naming it as spline interpolation
%[x,y]=meshgrid[-18:18;-28:28];