Challenge

Project - Data Handling and Interpolation


voltage_data = [-17.3, -17.1, -17, -16.8, -16.5, -16, -15, -14, -12, -10, -8, -5, -2, -0.2, 0.09, 0.19, 0.27, 0.39, 0.43, 0.5, 0.55, 0.6, 0.62, 0.65];
current_data = [-28, -24, -19, -14, -9, -6, -4, -3, -2, -1.3, -1, -0.6, -0.3, -0.1, 0, 0, 0, 0.01, 0.03, 0.17, 0.42, 1.23, 1.99, 3.91];

interp_range = -17.3:0.1:0.9;


interp_current = interp1(voltage_data, current_data, interp_range, 'linear');


figure;
plot(interp_range, interp_current, 'b', 'LineWidth', 2);
title('Interpolated Voltage-Current Relationship');
xlabel('Voltage (Volt)');
ylabel('Current (mAmp)');
grid on;


interpolated_data = [interp_range', interp_current'];
save('interpolated_data.txt', 'interpolated_data', '-ascii');

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.