Project - Data Handling and Interpolation
% This project reads the data form excel sheet and do a interpolation of
% the required range of data
V=xlsread("C:\Users\raj pandey\Downloads\VI (1).xlsx");
%reading the values of voltage and storing them into vector V
I=xlsread("C:\Users\raj pandey\Downloads\VI (1).xlsx");
%reading the values of current and storing them into vector I.
plot(V,I,'o'); %ploting V vs I ploting
hold on;%holding plot for overlaping
Vh=[-17.3:0.1:0.9]; % range of interplotation.
Ih=spline(Vh,I,Ih);
plot(Vh,Ih,'r--'); %ploting interploted Vh Vs Ih curve.
grid; %seting up the grid
xlabel('Voltage V(Volt)');% labeling the plot
ylabel('Current');
tittle('interploted V-I curve')
legend('Given data plot','interploted data plot');
hold off;
%computing the current from given values of voltage and storing them in
%atext file
VV=[-17.2 -17.1 -13.8 -13.5 -13.0 -12.5 -11 -9 -5.76 -6 -1 0.25 0.5 0.61];
%loading V as per given in the question
II=pchip(V,I,VV); %calcullating current using pchip interpolation
F=[VV,II];
name= 'calulating current from given data'; % tittle of text file
V=voltage(volt); %labeling the coloums of text file
i='current(mAmp)';
fid=fopen('mbproject.text','w');% creating file
fprint(fid,'%\n\n',name);
fprint(fid,'%s %s\n',v,i);
fprint(fid,%f%f\n',F);
fclose(fid);
figure(2)
plot(VV,II,'m'); %I ploting the plot in figure2
xlabel('voltage V(Volt)'); %labeling the plot
ylabel('Current(mAmp)');
tittle('Given Voltage Vs calculated current');