Challenge

Project - Data Handling and Interpolation

% Data Collection
data = readtable('VI.xlsx');
V = data.Volt; I = data.Amps;
% Interpolation
interpol_V = [-17.3:0.1:0.9];
interpol_I = interp1(V,I,interpol_V,'spline');
% Plotting and Formatting
plot(V,I,'b*',interpol_V,interpol_I,'m--');
xlabel('Voltage'); ylabel('Current');
grid; legend('Original Data','Interpolated data');
title('Current Variation');
% finding new current values for given voltage
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];
new_interpol_I = interp1(V,I,VV,'spline');
% Saving output to text file
file_out = [VV;new_interpol_I];
fpoint=fopen('VI_out.txt','w');
fprintf(fpoint,'%6s %12s\n','Volt','Amps');
fprintf(fpoint,'%6s %12s\n','----','----');
fprintf(fpoint,'%6.2f %12.2f\n',file_out);
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.