Project - Data Handling and Interpolation
QUESTION : data handling and interpolation
clear all
clc
%%taking data from xl file
data = xlsread('VI.xlsx'); %%reading data from xl file
V = data(:,1); %%reading data from first column
I = data(:,2); %%reading data from second column
x = -17.3:0.1:0.9; %%data given in the question
subplot(211)
plot(V,I,'r+'); %%ploating V-I curve from data point
legend('DATA PROVIDED')
title('data point given in the question')
%% Using Interpolation
Y = interp1(V,I,x);
subplot(212)
plot(Y,'g--')
title('data point found using interpolation ')
legend('missing data point in curve')
%%ploting interpolation curve
plot(V,I,'*r',x,Y,'g--');
title('complete curve after using interpolation')
legend('data provided','missing data point')
%%saving text file
fileID = fopen('final_project4.m','w');
fprintf(fileID,'%8s %10s\n','V(volt)','I(mAmp)');
fprintf(fileID,'%f %f\n',Y);
fclose(fileID);

