Challenge

Project - Data Handling and Interpolation

clc 
clear 
data=xlsread('VI.xlsx');
v=data(:,1);
i=data(:,2);
rq=[-17.3:0.1:0.9];
res=interp1(v,i,rq);
figure(1);
plot(v,i,rq,res);
xlabel('voltage')
ylabel('current')
hold on;
grid on;
title('linear interpolation for V-I');
vv=[-17.3,-17.2,-13.8,-13.5,-13.0,-12.5,-11,-9,-5.76,-6,-1,0.11,0.25,0.5,0.6]

ii=[-28.0 -26.0 -2.9 -2.75 -2.5 -2.25 -1.65 -1.15 -0.7013 -0.733 -0.1889 0 0 0.1700 1.2300]
z= [ii vv]
fileID =fopen('keerthan.txt','r')
fprintf(fileID,'%6s %12s/n','vv','ii');
fprintf(fileID,'%6.2f %12.8f/n',z);
fclose(fileID)
​
Alternate of finding the cuurent values 
clc
clear
data=xlsread('VI.xlsx');
v=data(:,1);
i=data(:,2);
current=interp1(v,i,-17.2);
current1=interp1(v,i,-13);
current2=interp1(v,i,-11);
current3=interp1(v,i,-9);
current4=interp1(v,i,-6);
current5=interp1(v,i,-1);
current6=interp1(v,i,0.11);
current7=interp1(v,i,0.25);
current8=interp1(v,i,0.5);
current9=interp1(v,i,0.61);
current10=interp1(v,i,0.66);
Summary of the project:
First most thing i had collected the data from the attached file VI.xlsx and then i read the data into matlab using xlsread command and i craeted a variable rq and i have assigned the values given and i used interp1 for the interpolation of one dimesion and created a variable res to do it then i plotted a graph between the all the parameters
I created a another file to find the values for the current for given voltages and i used the old data from the previous file from VI.xlsx i used the function interp1 for the interpolation and find out the values of the cuurent
Then i created a vector for the voltages vv and for the curent ii and assigned the values for those and created a another parameter z which is the resistance realtion of both voltage and current
Then open a text file keerthan.txt and then stored the values of voltage and current and the resistence and used the format of 'r' is to read the data from the the ouput of the matlab form the keerthan.txt text file
Summary on the graph of the V-I(according to ohms law )
V=IR
the graph which is the non linear V-i characteristics the resistence is not constant it depends on the voltage and current
the relationship existing between voltage and current depends upon voltage .if the voltage is reversed without changing the magnitude ,the current will become opposite but the magnitude will change
The slope of the graph is the resistance
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.