Project - Data Handling and Interpolation
Project :
In a laboratory experiment, data of voltage and current has been recorded and the same is attached in an excel file ( Click on this link VI.xlsx ). Read the excel file in the Matlab program and perform the interpolation in the range of -17.3:0.1:0.9. Generate the interactive plot for the interpolated data and store them in a text file.
ANSWER:
clc
clear all
[x]=xlsread('VI.xlsx',1); % to read the excel file
v=x(:,1); to %read the the input volt
i=x(:,2); % to read the input current
[e] =xlsread('VI.xlsx',2); % to read to excel file
Xq=e(:,1); % to read the missing volt
Vq = interp1(v,i,Xq); % tofind the interpolation data
plot(v,i,':.') % to create the plot
hold on
plot(Xq,Vq,'o')
fid = fopen('project_output.txt','w'); %to open the file id for output file
fprintf(fid,'%f',Vq); % print the file id
fclose(fid);
OUTPUT:
-26.000000
-2.500000
-1.650000
-1.150000
-0.733333
-0.188889
0.000000
0.000000
0.170000
1.610000
NaN