Project - Data Handling and Interpolation
ans)
filename = 'VI.xlsx';%to read file name
sheet = 1;
xlRange = 'A2:A25';%volate range in file
xlRange1 = 'B2:B25';% current range in file
V= xlsread(filename,sheet,xlRange);
I= xlsread(filename,sheet,xlRange1);
plot(V,I);% plot the graph
title('original');grid;
xlabel('Voltage(V)');ylabel('Current(I)');
figure(2);% plot to tnterpolated date
V1=(-17.3:0.1:0.9);% V1 range
I1=interp1(V,I,V1);%use the function of interpolated
plot(V1,I1);title('Interpolated Data');grid;
xlabel('voltage(V)');
ylabel('Currrent(I)');
fid=fopen('interpolated_data.txt','w');% to save the file
fprintf(fid, '%f %f\n',[V1;I1]);
fclose(fid);