Challenge

Project - Data Handling and Interpolation

clc;
clear;

dt=xlsread('D:\EV design\chall3\VI.xlsx'); %Saving the data from excel to a variable "dt"
V=dt(:,1);
I=dt(:,2);

iv=-17.3:0.1:0.9; % Setting interpolation range

ipl=interp1(V,I,iv); %Linear Interpolation (Default)

figure(1)
plot(V,I,'o',iv,ipl,'*');
title('Linear Interpolation');
file1 = fopen('linear_interpolation.txt','w');
fprintf(file1,'%6s %12s\n','V','I');
fprintf(file1,'%6.2f %12.8f\n',[iv ipl]);

ips=interp1(V,I,iv,'spline'); %Spline Interpolation

figure(2)
plot(V,I,'o',iv,ips,'*');
title('Spline Interpolation');
file2 = fopen('spline_interpolation.txt','w');
fprintf(file2,'%6s %12s\n','V','I');
fprintf(file2,'%6.2f %12.8f\n',[iv ips]);

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.