Project - Data Handling and Interpolation
Project:- Data handling and interpolation
VvsI = xlsread('VI.xlsx'); %The xlsread command is used to store the data in the spreadsheet
V = VvsI(:,1);
I = VvsI(:,2);
Range = -17.3:0.1:0.9;
P1 = interp1(V,I,Range,P1); %The interpolation command is used
subplot(211); plot(Range,P1); %Subplot(211) command is used for plotting 1st graph
title('current and voltage data of lab'); %Giving title as 'current and voltage data of lab' to plot
VV=[-17.3 -17.1 -17 -16.8 -16.5 -16 -15 -14 -12 -10 -8 -5 -2 -0.2 0.09 0.19 0.27 0.39 0.43 0.5 0.55 0.6 0.62 0.65]; %initializing voltage values given in spreadsheet
P2 = interp1(V,I,VV,'linear'); %The interpolation command is used
subplot(212); plot(VV,P2); %Subplot(212) command is used for plotting 2nd graph
title('voltage values'); %Giving title as 'current and voltage data of lab' to plot
print('Project_1','-dpdf); %saving the plot in pdf format
fileid = fopen('VIDATA.txt','w'); %fopen is used for opening the file
fprintf(fileid,'%fn',Range); %fprintf is used to display result on the screen
fclose(fileid) %fclose is used for clossing the file