Challenge

Project - Data Handling and Interpolation

Vol_Cur = readmatrix('VI_project.xlsx'); %reading the data from excel and loading it into Vol_Cur
V=Vol_Cur(:,1); %storing Voltage data to 'V'
I=Vol_Cur(:,2); %storing current data to 'I'
Vq=-17.3:0.1:0.9;
Iq1=interp1(V,I,Vq); %performing the linear interpolation for range Vq
Iq2=interp1(V,I,Vq,'spline'); %performing the spline interpolation for range Vq
figure(1)
plot(V,I,'o',Vq,Iq1,':.'); %plotting
grid;
xlabel('V(volts)'); %labelling
ylabel('I (mAmp)');
title('Current vs Voltage'); %title
gtext('Linear Interpolation')
figure(2)
plot(V,I,'o',Vq,Iq2,':.');
grid;
xlabel('V(volts)');
ylabel('I (mAmp)');
title('Current vs Voltage');
gtext('Spline Interpolation');
%writing the interpolated data to output file, VI_interpolated_data.txt
Fid=fopen('VI_interpolated_data.txt','w');
fprintf(Fid,'%f\n',Iq1);
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.