Project - Data Handling and Interpolation
Solution Of Project1):-
Main Program:-
% Program for Interpolation of Voltage vs Current Data .
clc
clear all;
% excel file should be read
file=xlsread('VI.xlsx')
% data format is kept compact
format compact;
% First column is read
V=file(:,1)
% second column is read
I=file(:,2)
% point of interpolation
x=-17.3:0.1:0.9;
y=interp1(V,I,x,'spline');
subplot(211);
% plotting of curv voltage vs current
plot(V,I,'o',x,y)
grid on
% axis Notations
title('Voltage vs Current')
xlabel('voltage')
ylabel('current')
grid on
% Voltage Datafrom excel sheet , For calculating Current Values
%%
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]
% txt file making for rquried volt and currents values .
fileID=fopen('VVII.txt','w');
fprintf(fileID,'%6s %12s\n','VV','II');
fprintf(fileID,'%6.2f%12.8f\n',z);
fclose(fileID);
Output :- As attached txt file Name :- 'VVII' and figure(Plot) of current_voltage_curv