Challenge

Project - Data Handling and Interpolation

Answer:

% Read the current values from VI.xls file

vi=xlsread('VI.xls','A2:A25');

% Read the voltage values from VI.xls file

vv=xlsread('VI.xls','B2:B25');

%intervals

xq=(-17.3:0.1:0.9);

%interpolation for values of xq

yq=interp1(vi,vv,xq);

%plote the vv v/s vi with(o) & interpolation values

plot(vv,vi,'o',yq,xq,'-')

% title added to graph

title('Data handling & Interpolation')

%added legend

legend('value','interpolation')

%added x-axis label as voltage

xlabel('voltage (volts)')

%added y-axis label as current

ylabel('current (mA)')

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

% computing interpolation with given data VV

I=interp1(vi,vv,VV);

% move interpolating values to Z matrix

Z=[VV I]

% created VI.text file

fid=fopen('VI.txt','w');

% stored values of Z matrix to VI.text file

fprintf(fid,'%dn',Z);

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.