Challenge

Project 1 - Data Handling and Interpolation

clc
clear all
%% using this command the excel file read
file=xlsread('VI.xlsx')
%% the data format is kept compact form
format compact;

%%  first column is read
V=file(:,1)
%%  second colunm 
I=file(:,2)
x=-17.3:0.1:0.9;
 y=interp1(V,I,x,'spline');
subplot(211);
plot(V,I,'o', x,y)
grid on
title('voltage vs current')
xlabel('voltage')
ylabel('current')
grid on

%% 
VV=[-17.2
    -17.1
    -13.8
    -13.5
-13
-12.5
-11
-9
-5.76
-6
-1
0.11
0.25
0.5
0.61]
II=interp1(V,I,VV)
z=[VV II]

fileID = fopen('VVII.txt','w');
fprintf(fileID,'%6s %12s\n','VV','II');
fprintf(fileID,'%6.2f %12.8f\n',z);
fclose(fileID);
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.