Challenge

Project - Data Handling and Interpolation

% interpolating given sets of data
data=readmatrix('VI.xlsx');
V=data(:,1);
I=data(:,2);
Vq=-17.3:0.1:0.9;
Iq1=interp1(V,I,Vq); % interp1 is used for one dimensional interpolation
Iq2=interp1(V,I,Vq,'spline');
figure(11);
plot(V,I,'o',Vq,Iq1,':.')
grid;
title('linear interpolation');
figure(12);
plot(V,I,'O',Vq,Iq2,':.');
grid;
title('spline interpolation');
fid=fopen('Iq2_spline_interpolation.txt','w'); %writing Iq2 in text file
len=length(Iq2);
for i=1:len
fprintf(fid,'%f\n',Iq2(i));
end
fclose(fid);
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.