Project - Data Handling and Interpolation
ANS:
clc
clear all
close all
data1=xlsread('VI.xlsx');
%it reads the data from xl file to the veriable matrix data1
V=data1(:,1);
%V is the varaiable stores the voltage.
I=data1(:,2);
%I is the Variable stores the current.
IV=[-17.3:0.1:0.9]
% it is the range of need to interpolation and it is voltage value
II=interp1(V,I,IV);
% current value of interpolation with respect to IV.
Z=[IV II];
%Z is the variable stores the Values in matrix
plot(V,I,'b*')
%it plots the intial value of the data
hold;
%holds the plot
grid;
%it provides the gride
plot(IV,II,'r--')
%it plotes the interpolation values
fileid = fopen('interpolation.txt','w')
%need to open the given ans in txt file so created the file with edit.
fprintf(fileid,'%4f\n',Z)
%prints data to the iterpolation fiel
fclose(fileid)
%close the file