Challenge

Project - Data Handling and Interpolation

clc;
clear;
A = xlsread('VI.xlsx');
v = A(:,1);
i = A(:,2);
v1 = -17.3:0.1:0.9;
ib1 = interp1(v,i,v1);
figure(1)
plot(v,i,'m:.',v1,ib1,'g--');
title('linear interpolation');xlabel('voltage');ylabel('current');
legend('original','interpolated');
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];
i2=interp1(v,i,vv);
figure(2)
plot(vv,i2,'g');
title('interpolation');xlabel('voltage');ylabel('current');
vvi2=[vv;i2];
fid = fopen('voltage_current.txt','w');
fprintf(fid,'%65s %10s\n','voltage','current');
fprintf(fid,'%5f %10f\n',vvi2);
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.