Challenge

Project - Data Handling and Interpolation

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.

Ans:-

clc
clear all
A=xlsread('interpolation.xlsx','sheet1','A2:b25');

V=A(:,1);
I=A(:,2);
T=-17.3:0.1:0.9;

figure(1)
B=interp1(V,I,T);
plot(V,I,'o',T,B,':.');
grid;
title('interpolation,volt and current');
fid=fopen('interpolation.txt','w');
fprintf(fid,'%d %f',B);
fclose(fid);

command

xlsread - used for read excel file in matlab

V - its the volt value in laboratry

I - its the current value in laboratry

T - its the given range

interp1 - used for interpolation

fopen - used for write text file

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.