Challenge

Project - Data Handling and Interpolation

A = xlsread('week4pro.xlsx');
x = A (:,1);
y = A (:,2);
xq = [-17.3:0.1:0.9];
yq1 = interp1(x,y,xq);
yq2 = interp1(x,y,xq,'spline');
figure(1);
plot(x,y,'o',xq,yq1,':.');
grid;
title('linear interpolation');
figure(2);
plot(x,y,'o',xq,yq2,':.');
grid;
title('spline interpolation');
f = fopen('week4.txt','w')
fprintf(f,'%f,yq1')
fclose(f)





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.