Project - Data Handling and Interpolation
PROJECT 1
a=xlsread('VI.xlsx');% excel file to read
V=a(:,1);%voltage defing from excel
I=a(:,2);% current defing from excel
x=[-17.3:0.1:0.9]% range for interplotation
y=interp1(V,I,x,'linear');% Interplotation
figure(1)% Figure
plot(V,I,'-ob',x,y,'markerfacecolor','r','linewidth',3);% Plotting datas
grid on % grid
title('Voltage vs current' )% Title of figure
ylabel('Current');% Y-axis as Current
xlabel('Voltage');% X-axis as Voltage
%%
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];%VV data Range
II=interp1(V,I,VV);%II data Interplotation
z=[VV II]% Ploting VV % II
%%
fileid=fopen("project.txt",'w');% file in txt
fprintf(fileid,'%6s %12s\n','VV','II');% output file
fprintf(fileid, '%6.2f %12.8f\n',z);% output file
fclose(fileid)% closing the fileid
figure(2)% figure 2
%%
plot(VV,II)%plotting VV vs II
grid on % grid
title('Voltage vs current' )% Title
ylabel('current'); % Y-axis
xlabel('voltage');% X-axis