Challenge

Project - Data Handling and Interpolation

Code:

c1=input('Enter 1 to read data from excel file: \n');
if c1==1
% Data from excel sheet
A=xlsread('VI.xlsx');
x=A(:,1);
y=A(:,2);
c2=input('Enter 1 to plot data V vs I: \n');
if c2==1
plot(x,y,'b*'); grid on; hold on;
end
end
c3=input('Enter 1 to interpolate data: \n');
for c3=1
% Interpolation
t=-17.3:0.1:0.9;
Yp=interp1(x,y,t);
plot(t,Yp,'o');
Yq=interp1(x,y,t,"spline");
plot(t,Yq,'m');
title('Interpolation')
legend('V vs I','Interpol','InterpolSp');
xlabel('Voltage V');
ylabel('Current I');
end
c4=input('Enter 1 to save data in .txt file: \n');
if c4==1
% Outout condition
Interpolation=[Yp,Yq];
filename=fopen('Interpolation_VI.txt','w');
fprintf(filename,'%f \t',Interpolation);
fclose(filename);
end
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.