Challenge

Project - Data Handling and Interpolation

clear all
clc
A=xlsread('VI.xlsx');
x=A(:,1);
y=A(:,2);
x1=-17.3:0.1:0.9; % test points/ query points
y1=interp1(x,y,x1,'linear');% method of interpolation(2 point optimization);
y2=interp1(x,y,x1,'spline'); % method of spline interpolation(4 point optimization);
y3=interp1(x,y,x1,'cubic'); % method of cubic interpolation(3 point optimization);
figure(1)
plot(x,y,x1,y1,'r*');
grid on
figure(2)
plot(x,y,x1,y2,'g*');
grid on
figure(3)
plot(x,y,x1,y3,'m*');
grid on
Z = [y1 y2 y3]
fileID = fopen('Abhinav.txt','w');
fprintf(fileID,'%s\t %s\t %s\n','linear','spline','cubic');
fprintf(fileID,'%f %f %f\n',y1,y2,y3);
fclose(fileID);
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.