Project - Data Handling and Interpolation
% Read the excel file
[num,txt,raw] = xlsread('VI.xlsx');
% Interpolate the data set
x = -17.3:0.1:0.9;
V = interp1(num(:,1),num(:,2),x);
%Generate the interactive plot
figure;
plot(x,V);
title('Interpolated Voltage vs. Current');
xlabel('Current (A)');
ylabel('Voltage (V)');
%Save the data in text file
fid = fopen('VI_data.txt','wt');
fprintf(fid,'Current\tVoltage\n');
for i=1:length(x)
fprintf(fid,'%f\t%f\n',x(i),V(i));
end