Project - Data Handling and Interpolation
Project :
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
%use xlsread command input from spreadsheet
data = xlsread('VI.xlsx');
%input data from spreadsheet first column in spreadsheet
v=data(:,1);
%input data from second column in spreadsheet
I=data(:,2);
plot(v,I,'.-b')
xlabel('voltage')
ylabel('current')
title('Generated value using interpolated')
%We set limit of x from -17.3 to 0.9
x=-17.3:0.1:0.9;
y=interp1(v,I,x);
hold on; grid on;
% Generated the interpolated data for plot.
plot(v,I,'-r',x,y)
%y is using v,I relationship generated value and save in text file.
writematrix (y,'file_1','Delimiter','tab')
% v is voltage and save in text file.
writematrix (v,'file_2')
%I is current and save in text file.
writematrix (I,'file_3')
