Challenge

Project - Data Handling and Interpolation

Read the excel file in the Matlab program and perform the interpolation in the range of -17.3:0.1:0.9.

Generate the interactive plot for the interpolated data.

matrix = xlsread('VI.xlsx'); % command is used to read the xl file
V = matrix(:,1); % sheet 1 column 1
I = matrix(:,2); % sheet 1 column 2
xv = -17.3:0.1:0.9; % range
xi = interp1(V,I,xv); % interpolation of v&i
plot(xv,xi,'r'); % command is used to plot v&i
xlabel('voltage');
ylabel('Amp');
title('V vs I'); % plot title
fid = fopen('current_out.txt','w'); % command is uesd to create the text file
xo=[-17.2 -13 -11 -9 -6 -1 0.11 0.25 0.5 0.61 0.66];
Io=interp1(V,I,xo);
output=[xo Io];
fprintf(fid,'%6s%8s\n','xo','Io'); % command is used in print the data
fprintf(fid,'%6.2f%8.2f\n',output);
fclose(fid); % command is used to close the file

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.