Challenge

Project - Data Handling and Interpolation

%reading the excel file
Data=xlsread('VI.xlsx');
%saving 2 column in to 2 variables
x=Data(:,1);
y=Data(:,2);

%writing interpolation range
xq=[-17.3:0.1:0.9];
yq1=interp1(x,y,xq);
figure(1);

%plotting the graph
plot(x,y,'o',xq,yq1,'-');xlabel('voltage');ylabel('current');
title('linear interpolation');

%defining the voltage vector
vv=[ -17.2 -17.1 -13.8 -13.5 -13.0 -12.5 -11 -9 -5.76 -6 -1 0.11 0.25 0.5 0.61];
yy=interp1(x,y,vv);
%writing the answers in to a text file
fid=fopen('Data_out.txt','w');
fprintf(fid,'%f\n',yy);
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.