Challenge

Project - Data Handling and Interpolation

getdata=xlsread("VI.xlsx"); %reading data from texr file
x=getdata(:,1);
y=getdata(:,2);
xq=-17.3:0.1:0.9;
yq=interp1(x,y,xq); %interpolating the data
figure(1);
plot(x,y,'o',xq,yq,':.');grid; %plotting the data
title ('voltage-current interpolated data');
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];
yq2=interp1(x,y,VV); %interpolating the VV
figure(2);
plot(x,y,'o',VV,yq2,':.');grid; %plotting
fileid =fopen('current_values.txt','w'); %saving yq2 data in text file current values
len=length('current_values');
for i=1:len,
fprintf(fileid,'%.2f\n',yq2(i)); %printing the data
end
fclose(fileid);
values in .txt file
-26.00
-24.00
-2.90
-2.75
-2.50
-2.25
-1.65
-1.15
-0.70
-0.73
-0.19
0.00
0.00
0.17
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.