Project - Data Handling and Interpolation
PROBLEM STATEMENT:
In a laboratory experiment, data of voltage and current has been recorded and the same is attached in an excel file ( Click on this link VI.xlsx ). Read the excel file in the Matlab program and perform the interpolation in the range of -17.3:0.1:0.9. Generate the interactive plot for the interpolated data and store them in a text file.
mfile:
clc; %to clear screen%
clear all; %to clear workspace%
close all; % to close all tab%
VI= xlsread("VI.xlsx");
V= VI(:,1);
I= VI(:,2);
X= -17.3:0.1:0.9; %INTERPOLATION RANGE%
Y= interp1(V,I,X,"spline");
plot(V,I,'O',X,Y);grid;
title('voltage vs current')
xlabel('voltage in volts')
ylabel('current in mAmps')
fid=fopen('project_datahandling.txt','w');
len=length(VI);
for i=1:len
fprintf(fid,'%d\n',V,I);
end
fclose(fid);
