Project - Data Handling and Interpolation
% FILE VI.xlsx is stored in current folder, V and I values with resistance value 2000ohm
M=xlsread('VI.xlsx'); % xlsread for reading experiment datas of current(mA) and voltage(v)
V=-18:0.1:1; % Voltage values
I=-9:0.05:0.5; % current values
Vi=-17.3:0.1:0.9 % Voltage values for interval of -17.3:0.1:0.9
Ii=interp1(V,I,Vi) % interpolation for Current values for the voltage range -17.3:0.1:0.9
plot(V,I,'o',Vi,Ii)
xlabel('V and Vi Values');
ylabel('I and Ii Values');
title('interpolation of datas');
grid;
legend('Volage','current');
Vii=[-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];
Iii=interp1(V,I,Vii); % interpolation for Current values for the voltage range Vii
fprintf(1,'%.f',Iii)

Vi =
Columns 1 through 14
-17.3000 -17.2000 -17.1000 -17.0000 -16.9000 -16.8000 -16.7000 -16.6000 -16.5000 -16.4000 -16.3000 -16.2000 -16.1000 -16.0000
Columns 15 through 28
-15.9000 -15.8000 -15.7000 -15.6000 -15.5000 -15.4000 -15.3000 -15.2000 -15.1000 -15.0000 -14.9000 -14.8000 -14.7000 -14.6000
Columns 29 through 42
-14.5000 -14.4000 -14.3000 -14.2000 -14.1000 -14.0000 -13.9000 -13.8000 -13.7000 -13.6000 -13.5000 -13.4000 -13.3000 -13.2000
Columns 43 through 56
-13.1000 -13.0000 -12.9000 -12.8000 -12.7000 -12.6000 -12.5000 -12.4000 -12.3000 -12.2000 -12.1000 -12.0000 -11.9000 -11.8000
Columns 57 through 70
-11.7000 -11.6000 -11.5000 -11.4000 -11.3000 -11.2000 -11.1000 -11.0000 -10.9000 -10.8000 -10.7000 -10.6000 -10.5000 -10.4000
Columns 1 through 14
-17.3000 -17.2000 -17.1000 -17.0000 -16.9000 -16.8000 -16.7000 -16.6000 -16.5000 -16.4000 -16.3000 -16.2000 -16.1000 -16.0000
Columns 15 through 28
-15.9000 -15.8000 -15.7000 -15.6000 -15.5000 -15.4000 -15.3000 -15.2000 -15.1000 -15.0000 -14.9000 -14.8000 -14.7000 -14.6000
Columns 29 through 42
-14.5000 -14.4000 -14.3000 -14.2000 -14.1000 -14.0000 -13.9000 -13.8000 -13.7000 -13.6000 -13.5000 -13.4000 -13.3000 -13.2000
Columns 43 through 56
-13.1000 -13.0000 -12.9000 -12.8000 -12.7000 -12.6000 -12.5000 -12.4000 -12.3000 -12.2000 -12.1000 -12.0000 -11.9000 -11.8000
Columns 57 through 70
-11.7000 -11.6000 -11.5000 -11.4000 -11.3000 -11.2000 -11.1000 -11.0000 -10.9000 -10.8000 -10.7000 -10.6000 -10.5000 -10.4000
Columns 71 through 84
-10.3000 -10.2000 -10.1000 -10.0000 -9.9000 -9.8000 -9.7000 -9.6000 -9.5000 -9.4000 -9.3000 -9.2000 -9.1000 -9.0000
Columns 85 through 98
-8.9000 -8.8000 -8.7000 -8.6000 -8.5000 -8.4000 -8.3000 -8.2000 -8.1000 -8.0000 -7.9000 -7.8000 -7.7000 -7.6000
Columns 99 through 112
-7.5000 -7.4000 -7.3000 -7.2000 -7.1000 -7.0000 -6.9000 -6.8000 -6.7000 -6.6000 -6.5000 -6.4000 -6.3000 -6.2000
Columns 113 through 126
-6.1000 -6.0000 -5.9000 -5.8000 -5.7000 -5.6000 -5.5000 -5.4000 -5.3000 -5.2000 -5.1000 -5.0000 -4.9000 -4.8000
Columns 127 through 140
-4.7000 -4.6000 -4.5000 -4.4000 -4.3000 -4.2000 -4.1000 -4.0000 -3.9000 -3.8000 -3.7000 -3.6000 -3.5000 -3.4000
Columns 141 through 154
-10.3000 -10.2000 -10.1000 -10.0000 -9.9000 -9.8000 -9.7000 -9.6000 -9.5000 -9.4000 -9.3000 -9.2000 -9.1000 -9.0000
Columns 85 through 98
-8.9000 -8.8000 -8.7000 -8.6000 -8.5000 -8.4000 -8.3000 -8.2000 -8.1000 -8.0000 -7.9000 -7.8000 -7.7000 -7.6000
Columns 99 through 112
-7.5000 -7.4000 -7.3000 -7.2000 -7.1000 -7.0000 -6.9000 -6.8000 -6.7000 -6.6000 -6.5000 -6.4000 -6.3000 -6.2000
Columns 113 through 126
-6.1000 -6.0000 -5.9000 -5.8000 -5.7000 -5.6000 -5.5000 -5.4000 -5.3000 -5.2000 -5.1000 -5.0000 -4.9000 -4.8000
Columns 127 through 140
-4.7000 -4.6000 -4.5000 -4.4000 -4.3000 -4.2000 -4.1000 -4.0000 -3.9000 -3.8000 -3.7000 -3.6000 -3.5000 -3.4000
Columns 141 through 154
-3.3000 -3.2000 -3.1000 -3.0000 -2.9000 -2.8000 -2.7000 -2.6000 -2.5000 -2.4000 -2.3000 -2.2000 -2.1000 -2.0000
Columns 155 through 168
-1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000 -1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000
Columns 169 through 182
-0.5000 -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000
Column 183
0.9000
Columns 155 through 168
-1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000 -1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000
Columns 169 through 182
-0.5000 -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000
Column 183
0.9000
i =
Columns 1 through 14
-8.6500 -8.6000 -8.5500 -8.5000 -8.4500 -8.4000 -8.3500 -8.3000 -8.2500 -8.2000 -8.1500 -8.1000 -8.0500 -8.0000
Columns 15 through 28
-7.9500 -7.9000 -7.8500 -7.8000 -7.7500 -7.7000 -7.6500 -7.6000 -7.5500 -7.5000 -7.4500 -7.4000 -7.3500 -7.3000
Columns 29 through 42
-7.2500 -7.2000 -7.1500 -7.1000 -7.0500 -7.0000 -6.9500 -6.9000 -6.8500 -6.8000 -6.7500 -6.7000 -6.6500 -6.6000
Columns 43 through 56
-6.5500 -6.5000 -6.4500 -6.4000 -6.3500 -6.3000 -6.2500 -6.2000 -6.1500 -6.1000 -6.0500 -6.0000 -5.9500 -5.9000
Columns 57 through 70
Columns 1 through 14
-8.6500 -8.6000 -8.5500 -8.5000 -8.4500 -8.4000 -8.3500 -8.3000 -8.2500 -8.2000 -8.1500 -8.1000 -8.0500 -8.0000
Columns 15 through 28
-7.9500 -7.9000 -7.8500 -7.8000 -7.7500 -7.7000 -7.6500 -7.6000 -7.5500 -7.5000 -7.4500 -7.4000 -7.3500 -7.3000
Columns 29 through 42
-7.2500 -7.2000 -7.1500 -7.1000 -7.0500 -7.0000 -6.9500 -6.9000 -6.8500 -6.8000 -6.7500 -6.7000 -6.6500 -6.6000
Columns 43 through 56
-6.5500 -6.5000 -6.4500 -6.4000 -6.3500 -6.3000 -6.2500 -6.2000 -6.1500 -6.1000 -6.0500 -6.0000 -5.9500 -5.9000
Columns 57 through 70
-5.8500 -5.8000 -5.7500 -5.7000 -5.6500 -5.6000 -5.5500 -5.5000 -5.4500 -5.4000 -5.3500 -5.3000 -5.2500 -5.2000
Columns 71 through 84
-5.1500 -5.1000 -5.0500 -5.0000 -4.9500 -4.9000 -4.8500 -4.8000 -4.7500 -4.7000 -4.6500 -4.6000 -4.5500 -4.5000
Columns 85 through 98
-4.4500 -4.4000 -4.3500 -4.3000 -4.2500 -4.2000 -4.1500 -4.1000 -4.0500 -4.0000 -3.9500 -3.9000 -3.8500 -3.8000
Columns 99 through 112
-3.7500 -3.7000 -3.6500 -3.6000 -3.5500 -3.5000 -3.4500 -3.4000 -3.3500 -3.3000 -3.2500 -3.2000 -3.1500 -3.1000
Columns 113 through 126
-3.0500 -3.0000 -2.9500 -2.9000 -2.8500 -2.8000 -2.7500 -2.7000 -2.6500 -2.6000 -2.5500 -2.5000 -2.4500 -2.4000
Columns 127 through 140
Columns 71 through 84
-5.1500 -5.1000 -5.0500 -5.0000 -4.9500 -4.9000 -4.8500 -4.8000 -4.7500 -4.7000 -4.6500 -4.6000 -4.5500 -4.5000
Columns 85 through 98
-4.4500 -4.4000 -4.3500 -4.3000 -4.2500 -4.2000 -4.1500 -4.1000 -4.0500 -4.0000 -3.9500 -3.9000 -3.8500 -3.8000
Columns 99 through 112
-3.7500 -3.7000 -3.6500 -3.6000 -3.5500 -3.5000 -3.4500 -3.4000 -3.3500 -3.3000 -3.2500 -3.2000 -3.1500 -3.1000
Columns 113 through 126
-3.0500 -3.0000 -2.9500 -2.9000 -2.8500 -2.8000 -2.7500 -2.7000 -2.6500 -2.6000 -2.5500 -2.5000 -2.4500 -2.4000
Columns 127 through 140
-2.3500 -2.3000 -2.2500 -2.2000 -2.1500 -2.1000 -2.0500 -2.0000 -1.9500 -1.9000 -1.8500 -1.8000 -1.7500 -1.7000
Columns 141 through 154
-1.6500 -1.6000 -1.5500 -1.5000 -1.4500 -1.4000 -1.3500 -1.3000 -1.2500 -1.2000 -1.1500 -1.1000 -1.0500 -1.0000
Columns 155 through 168
-0.9500 -0.9000 -0.8500 -0.8000 -0.7500 -0.7000 -0.6500 -0.6000 -0.5500 -0.5000 -0.4500 -0.4000 -0.3500 -0.3000
Columns 169 through 182
-0.2500 -0.2000 -0.1500 -0.1000 -0.0500 0 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000
Column 183
0.4500
Columns 141 through 154
-1.6500 -1.6000 -1.5500 -1.5000 -1.4500 -1.4000 -1.3500 -1.3000 -1.2500 -1.2000 -1.1500 -1.1000 -1.0500 -1.0000
Columns 155 through 168
-0.9500 -0.9000 -0.8500 -0.8000 -0.7500 -0.7000 -0.6500 -0.6000 -0.5500 -0.5000 -0.4500 -0.4000 -0.3500 -0.3000
Columns 169 through 182
-0.2500 -0.2000 -0.1500 -0.1000 -0.0500 0 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000
Column 183
0.4500
%fprintf command displays the result with roundoff
-9-9-7-7-6-6-6-4-3-3-00000
Iii =
Columns 1 through 14
-8.6000 -8.5500 -6.9000 -6.7500 -6.5000 -6.2500 -5.5000 -4.5000 -2.8800 -3.0000 -0.5000 0.0550 0.1250 0.2500
Column 15
0.3050
plot(Vi,Ii,'o',Vii,Iii);
xlabel('Vi and Vii Values');
ylabel('Ii and Iii Values');
title('interpolation of datas');
grid;
legend('Volage','current');
