Challenge

Project - Data Handling and Interpolation

Project :

In a laboratory experiment, data of voltage and current has been recorded and the same is attached in an excel file ( VI.xlsx ). 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. Additionally, compute the current values for given voltages below and store them in a text file.

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]’

Solution:

% Project implementation for data handling and Interpolation


VI_matrix = xlsread('VI_data.xlsx'); % read the data from excell file
V=VI_matrix(:,1);
I=VI_matrix(:,2);
Vq=-17.3:0.1:0.9; % considered the range of data for interpolation
xq=interp1(V,I,Vq);
plot(V,I,'o',Vq,xq,':.');
title('Default Interpolation');

command window

>> VI_matrix_proj % File compiled without errors

------------------------------------------------------------------

% writing of computed current values to text file

% 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];
Iq=[-26 -24 -2.9 -2.75 -2.5 -2.25 -1.65 -1.15 -0.71 -0.19 0 0 0.17 1.98]; % Data computed from the graph generated
fid=fopen('D:\Challenge_week4\current_values.txt','w');
len=length(Iq);
for i= 1:len
fprintf(fid,'%f\n',Iq(i));
end
fclose(fid);

command window

>> Ii_values % File compiled without errors

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.