Project - Data Handling and Interpolation
voltvscurrentdata = xlsread('VI (1).xlsx'); %xlsread comand to read data from excel
V=voltvscurrentdata(:,1); % define a varible v to get only volt values
I=voltvscurrentdata(:,2); %define a variable I to get current values
Vq = [-17.3:0.1:0.9]; % define a variable vq to set limits
plot(V,I,'r*'); % plot datas
grid;hold %grid and hold fig
xlabel('V');ylabel('I'); %label x and y axis
Iq1 = interp1(V,I,Vq); %define Iq1 to interolation of v, i ,vq
Z = [Vq;Iq1]; %define a matrics Z to store Vq and iq1 datas
plot(Vq,Iq1,'b--') % plot datas
grid;hold;legend('V & I','Vq & Iq1')
fileid=fopen('viout.txt','w'); %define fopen to write in txt file.
fprintf(fileid,'%g\n',Z); %define fprintf to enter values of Z
fclose(fileid);