Project - Data Handling and Interpolation
AIM
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.
Key Highlights:
- Graphical solutions are more visual and appealing
- Interpolation of data
- Read excel file
- Write to text file
Deliverables:
- Find missing data and save it in text
- Interpolate the data set
- Save your program and attach the same.
- Save txt file and upload in attachment
project
clear all
%% using this command the excel file read
file=readmatrix('VI.xlsx')
V=file(:,1)
I=file(:,2)
x=-17.3:0.1:0.9;
y1=interp1(V,I,x,'linear');
y2=interp1(V,I,x,'spline');
%% Linear Interpolation
figure(1)clc
plot(V,I, x,y1,'r*')
grid on
title('Linear Interpolation')
xlabel('voltage')
ylabel('current')
grid on
%% Spline Interpolation
figure(2)
plot(V,I,x,y2,'b*')
grid on
title('Spline Interpolation')
xlabel('voltage')
ylabel('current')
grid on
OUTPUT