Challenge

Project - Data Handling and Interpolation

%Final Project Matlab


VI=xlsread('VI.xlsx'); % Read the xlxs file given.
V=VI(:,1); % Define V in the Matrix -VI (column 1).
I=VI(:,2); % Define I in the Matrix -VI (column 2).
plot(V,I,'*'); % plot all the values of V & I.
hold;

xlabel('V'); % label X axis.
ylabel ('I'); % label y axis.
V1=(-17.3:0.1:0.9); % Define the range given.
I1=interpl(V,I,V1,'spline'); %perform interpolation
plot(V1,I1,':.'); % plot interpolation.
legend('Original Data','Spline Interpolation'); %lable the legends.

V2=xlsread('VI.xlsx','sheet2'); %Read the xlsx file.
I2=interp1(V,I,V2,'spline'); %perform interpolation.
fileID = fopen('I2.txt','w'); %function to open txt file.
fprintf(fileID,'%f\n',I2); % Write value of I2 into txt file.
fclose(fileID);

Explanation:

**The question has been divided into three stages at the first stage the xlsx excel data is added that is given in the question on the first line then on the second line, defined V and I, values for the columns have given here. With the values and V I graph has been plotted. and is uploaded here

**In the next stage, an interpolation is performed with the given range. Using that range and output graph is plotted with the original data and spline interpolation

**In the last 5 steps, computed the current values for given voltages and stored them in a text file.

For more clarification, the explanation of each step has been given against each line as section title (%)

Mat files, screenshots, txt file, and plotted graphs have been uploaded here.

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.