Challenge

Project - Data Handling and Interpolation

excelFileName = 'VI.xlsx';
% Read data from Excel file using readtable
dataTable = readtable(excelFileName);
% Extract voltage and current data
voltage = dataTable{:, 'Voltage'};
current = dataTable{:, 'Current'};
% Handle missing data using fillmissing
current = fillmissing(current, 'linear');
% Define the range for interpolation
interpolationRange = -17.3:0.1:0.9;
% Perform interpolation on the entire dataset
interpolatedCurrent = interp1(voltage, current, interpolationRange, 'linear');
% Generate interactive plot
figure;
plot(voltage, current, 'o', interpolationRange, interpolatedCurrent, '-');
title('Interpolated Data with Missing Data Handling');
xlabel('Voltage');
ylabel('Current');
legend('Original Data', 'Interpolated Data', 'Location', 'Best');
grid on;
% Save the program
programFileName = 'interpolation_program_using_readtable.m';
save(programFileName);
% Save the interpolated data to a text file
outputFileName = 'interpolated_data_using_readtable.txt';
save(outputFileName, 'interpolationRange', 'interpolatedCurrent', '-ascii');
disp(['Interpolated data with missing data handling saved to ' outputFileName]);
disp(['Program saved to ' programFileName]);
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.