Challenge

Project - Data Handling and Interpolation

1)A)

clc
clear all
data = xlsread('VI.xlsx'); % import the xlsx file
V = data(:,1); % defining voltage in variable V from excel file
I = data(:,2); % defining current in a variable I from excel file
x = [-17.3:0.1:0.9]; % defining the range for interpolation
x1 = interp1(V,I,x); % interpolation applied
figure(1);
plot(V,I,'bo',x,x1,'r--');grid; % plotting the interpolation and applying grid
xlabel('VOLTAGE(Volt)'); ylabel('CURRENT(mAMP)'); %label V and I as voltage and current respectively
title('INTERPOLATION PLOT'); %title of plot
legend('I=5mAmp','V=2Volt'); %legend of the plot
filename=fopen('interpolated data.txt','w');
fprintf(filename,'%d','x1'); % print the output x1 to the text file
fclose(filename);
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.