Challenge

Project - Data Handling and Interpolation

clear all
load VI.mat %loading the excel file VI after importing date from import data
V=VI.VVolt; %giving a variable V then the filename with extension of Vvolt (coloumn variable name)
I=VI.ImAmp; %giving a variable I then the filename with extension of ImAmp
xq=(-17.3:0.1:0.9); %interpolation in range
yq1=interp1(V,I,xq); %interp1 for 2D interpolation
yq2=interp1(V,I,xq,'spline');
figure(1)
plot(V,I,'o',xq,yq1,'b--');
grid;
figure(2)
plot(V,I,'o',xq,yq2,'m--');
xlabel('voltage');ylabel('current'); %plotting the graph
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];
fid=fopen('voltage.txt','w'); %opening a file name voltage.txt
len=length(VV); %len file for length of variable vv
for i=1:len
fprintf(fid, '%d',VV(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.