Project - Data Handling and Interpolation
Dear Assessor,
Thank you for your time.
The Matlab code file, output text file and output screenshot are attached for your reference. Refer to the following for the required Matlab code:
data=xlsread("VI.xlsx");
V=data(:,1);
I=data(:,2);
V1= -17.3:0.1:0.9;
C1= interp1(V,I,V1,'linear','extrap');
plot(V,I,'bo','MarkerSize',12);
hold on;
plot(V1,C1,'r:.','LineWidth',2);
xlabel('Voltage');
ylabel('Current');
legend('Available Data Points','Linear Interpolation','Location','southeast');
title('Linear Interpolation with Available Data')
grid on;
Voltage= transpose(V1);
Current= transpose(C1);
T= table(Voltage,Current);
writetable(T, 'interpolation_data.txt');
disp('Interpolated data points are saved in default folder in text file named "interpolation_data"');
Submitted for review and your kind approval.
Regards,
Bilal