Project - Data Handling and Interpolation
clc
clear all
interpol=xlsread('VI.xlsx','Sheet1','A2:B25') % IMPORTING THE XLXS SHEET FROM XL TO MATLAB
V=interpol(:,1);% assembling voltage values from xl coloumn 1
I=interpol(:,2);% assembling current values from xl coloumn 2
figure(1)
plot(V,I,'r');% plotting voltage vs current
X=-17.3:0.1:0.9; % asembling given range in question
Y=interp1(V,I,X,'spline'); %interpolating the values
plot(V,I,'o',X,Y); %ploting the interpolated values with the voltage and current
title('interpolation voltage vs current');
v_1=interp1(V,I,-17.2)% finding the interpolated values for given question
v_2=interp1(V,I,-17.1)
v_3=interp1(V,I,-13.8)
v_4=interp1(V,I,-13.5)
v_5=interp1(V,I,-13.0)
v_6=interp1(V,I,-12.5)
v_7=interp1(V,I,-11)
v_8=interp1(V,I,-9)
v_9=interp1(V,I,-5.76)
v_10=interp1(V,I,-6)
v_11=interp1(V,I,-1)
v_12=interp1(V,I,0.11)
v_13=interp1(V,I,0.25)
v_14=interp1(V,I,0.5)
v_15=interp1(V,I,0.61)
PART B
Z=[-26.000 -24 -2.9000 -2.7500 -2.5000 -2.2500 -1.6500 -1.1500 -0.7013 -0.7333 -0.1889 0 0 0.1700 1.6100]
W=[-17.2 -17.1 -13.8 -13.5 -13.0 -12.5 -11 -9 -5.76 -6 -1 0.11 0.25 0.5 0.61]
figure(2)
plot(Z,W,'R')
title('NEWPLOT')
xlabel('current')
ylabel('voltage')