Challenge

Project - Data Handling and Interpolation

m=xlsread('VI.xlsx');%reading from excel file
v=[m(:,1)];%assigning voltage values as v
c=[m(:,2)];%assigning current values as c
w=[-17.2 -17.1 -13.8 -13.5 -13 -12.5 -11 -9 -5.76 -6 -1 0.11 0.25 0.5 0.61];%assigning w for values to which data to be found
x=[-17.3:0.1:0.9];%range
y=interp1(v,c,x,'spline');%interpolating voltage and current values
z=interp1(v,c,w,'spline');%interpolating same data and finding values of w
plot(v,c,'o',x,y,':.');grid;%plotting the values with a spline curve
title('VOLTAGE vs CURRENT INTERPOLATION');%labelling and annotation
xlabel('voltage');ylabel('current');
fid=fopen('currentvaluevv.txt','w');%opening and writing a text file and saving the current values for the given 'w'
l=length(z);
for i=1:l
fprintf(fid,'%f',z(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.