Challenge

Project - Data Handling and Interpolation

MATLAB Basics

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 the excel file
  • Write to a text file

Deliverables:

  • Find missing data and save it in the text
  • Interpolate the data set
  • Save your program and attach the same.
  • Save the text file and upload it in the attachment

Solution:-

Matlab Code:

%Project :
%In a laboratory experiment, data of voltage and current has been recorded 
%and the same is attached in an excel file. 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.

close
clear
clc
A = xlsread('VI.xlsx'); %Reading the excel data file
V = A(:,1); %Voltage
I = A(:,2); %Current
x = -17.3:0.1:0.9;

y = interp1(V,I,x); %Using interpolation command

plot(y) %Ploting
title('interpolated data')

fileid = fopen('Project.txt','w'); %Saving text file
fprintf(fileid, '%8s %10s\n','V(volt)', 'I(mAmp)');
fprintf(fileid, '%f %f\n', y);
fclose(fileid);

Output:

Text file data:

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.