Project - Data Handling and Interpolation
% Load the data from the excel file
data = xlsread('VI.xlsx');
% Separate the voltage and current data
voltage = data(:,1);
current = data(:,2);
% Perform interpolation
vq = -17.3:0.1:0.9; % query points for interpolation
iq = interp1(voltage,current,vq,'linear'); % interpolated current values
% Generate an interactive plot
figure
plot(voltage,current,'o',vq,iq,'-')
xlabel('Voltage')
ylabel('Current')
title('Interpolated VI Data')
legend('Original Data','Interpolated Data','Location','northwest')
grid on
zoom on
% allow user to interact with the plot
% Save interpolated data to a text file
interpolated_data = [vq' iq'];
save('interpolated_data.txt','interpolated_data','-ascii');