Challenge

Project - Data Handling and Interpolation

% data handling & interpolation
%%
vi = xlsread('VI.xlsx'); %import the excel sheet data
v = vi(:,1); %extract voltage data
i = vi(:,2); %extracting current data
plot(v,i,'ro'); %plot the graph V & I
hold on;
grid on; grid minor; %showing grid
xlabel('I(ampere)'); %label x axis
ylabel('V(volt)'); %label y axis
%%
v2 = -17.3:0.1:0.9; %interpolation voltage range
i2 = spline(v,i,v2); %calculate current values
A = [v2;i2]; %enter new data current & voltage
plot(v2,i2,'b'); %ploting graph with new data
legend({'old','new'},'location','southeast'); %name the graph posotion
%%
v3 = xlsread('VI.xlsx',2); %extract voltage data from 2nd sheet of excel
%v3 =[-17.2 -17.1 -13.8 -13.5 -13.0 -12.5 -11 -9 -5.76 -6 -1,....
% 0.11 0.25 0.5 .61];
i3 = spline(v,i,v3); %interpolation of current values for given voltage
intp = [v3 i3]; %given voltage & interpolation current values
%%
%f = fopen('interpolation.txt','wt');
%for j=1:length(intp)
% fprintf(f,'%d %d\n'intp(j,l),intp(j,2));
%end
%fclose(f);
%%
f = fopen('interpolation.txt','w'); %writing text file of interpolation
fprintf(f,'%.3f %.3f\n',[v3; i3]); %print the text file
fclose(f); %close the file
%%
n = fopen('int_data.txt','w'); %writing text file of interpolation
fprintf(n,'%2f\n',[v2;i2]); %print the text file
fclose(n); %close the file.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.