Challenge

Project - Data Handling and Interpolation

Project - Data Interpolation of volt and current by reading excel file.

% Data Interpolation of volage and current
Data=xlsread('VI.xlsx'); % first read the data from xlsx file
V=Data(:,1); % Define voltage data
A=Data(:,2); % define current data
xq=[-17.3:0.1:0.9]; % Range of interpolation
% here we start the linear interpolation of data
xq1=interp1(V,A,xq);
subplot(211)
plot(V,A,'r*',xq,xq1,'b-');
grid; % linear interpolation
title('Linear Interpolation');
xlabel('voltage(v)');
ylabel('current(A)');
% here we start spline interpolation of data
xq2=interp1(V,A,xq,'spline');
subplot(212)
plot(V,A,'r*',xq,xq2,'g-');
grid; % spline interpolation
title('spline Interpolation');
xlabel('voltage(V)');
ylabel('current(A)');
fileID=fopen('Interpolation_Data.txt','w'); % open interpolation.txt file
fprintf('%dn',V,A); % save the values of V and A in file
fclose(fileID); % 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.