Challenge

Project - Data Handling and Interpolation

clc
clear all
interpol=xlsread("VI.xlsx","sheet1","A2:B25");
% reaing xl to matlab
V=interpol(:,1);
I=interpol(:,2);
plot(V,I,'b');
title('volt vs current');
xlabel('I');
ylabel('V');
%% using the given equation in questine
X=-17.3:0.1:0.9;
Y=interp1(V,I,X,'linear');
plot(V,I,'or');
hold on
plot(X,Y,'--b');
title('liner interplotation current and voltage');
xlabel('X');
ylabel('Y');
grid on
%% Spline interplotation
X=-17.3:0.1:0.9;
Y=interp1(V,I,X,'spline');
plot(V,I,'or');
hold on
plot(X,Y,'--b');
title('spline interplotation current and voltage');
xlabel('X');
ylabel('Y');
grid on
% finding the interploted values from givin sums
V_1=interp1(V,I,-17.2);
V_2=interp1(V,I,-13);
V_3=interp1(V,I,-11);
V_4=interp1(V,I,-9);
V_5=interp1(V,I,-6);
V_6=interp1(V,I,-1);
V_7=interp1(V,I,0.11);
V_8=interp1(V,I,0.25);
V_9=interp1(V,I,0.5);
V_10=interp1(V,I,0.61);
V_11=interp1(V,I,0.66);
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.