Challenge

Project - Data Handling and Interpolation

  • METHOD 1: Project name--VI_myway.m (Attachments--VI_myway_output_curve.fig & VI_output_myway.txt)
clear all
close all
clc
VI=xlsread('C:\Users\Nikhil\Documents\MATLAB\project\VI.xlsx'); %Read the data which was provided by skill lync
x=VI(:,1); y=VI(:,2); % store entire row of first column in x and store entire row of second column in y
xq=-17.3:0.1:0.9; % defining the range given in question
yq=interp1(x,y,xq,'linear'); % Using Interpolation to find the missing Values Between the range
subplot(211); plot(xq,yq); title('V vs I data from lab'); xlabel('Volt'); ylabel('Ampere');
x_interpol=[-17.2 -13 -11 -9 -6 -1 0.11 0.25 0.5 0.61 0.66];
Xq=-17.3:1.7:0.66; % defining the adjusted range according to x_interpol
Yq=interp1(x_interpol,Xq,'linear'); % Using Interpolation to find the missing Values Between the given 11 values
subplot(212); plot(x,y,Xq,Yq); title('V vs I data interpoled'); xlabel('Volt'); ylabel('Ampere');
fileidl=fopen('C:\users\Nikhil\Documents\project\VI.xlsx','r'); % reading values stored in excelsheet
fileid=fopen('C:\users\Nikhil\Documents\MATLAB\project\VIoutput_myway.txt','w'); %Creating a text file to insert interpoled numbers
fprintf(fileid,'%d',Xq);
  • METHOD 2: Project name--Project_secondmethod.m (Attachments--project_secondmethod_Fig(1,2&3).fig & project_secondmethod_output.txt)
clc
VI=xlsread('C:\Users\Nikhil\Documents\MATLAB\project\VI.xlsx'); %Read the data which was provided by skill lync
VVolt=VI(:,1); ImAmp=VI(:,2); % store entire row of first column in VVolt and store entire row of second column in ImAmp
figure(1);
plot(VVolt,ImAmp,'-ob','MarkerFacecolor','r','linewidth',2); % plotting the given Volt and Amphere values
title('VVolt vs ImAmp');
xlabel('Volt'); ylabel('Ampere');
Vrange=-17.3:0.1:0.9; % Introducing the range given in the question
x= interp1(VVolt,ImAmp,Vrange,'linear'); % Using Interpolation to find the missing Values Between the range
figure(2)
plot(VVolt,ImAmp,'-ob',Vrange,x,'r'); % plotting Volt vs Ampere using interpolation method
title('V vs I interpoled at specified range');
xlabel('Volt'); ylabel('Ampere');
VI=[-17.2 -13 -11 -9 -6 -1 0.11 0.25 0.5 0.61 0.66]; % Defining the set of values given in the file
Vrange=-17.3:0.1:0.9;
y=interp1(x,Vrange); % Using Interpolation To find the missing variables of Given 11 voltage Values
figure(3);
plot(Vrange,x,'o',Vrange,y,'*');
xlabel('Volt');
ylabel('Ampere');
legend('Vrange','y');
fileidl=fopen('C:\users\Nikhil\Documents\project\VI.xlsx','r');
fileid=fopen('C:\users\Nikhil\Documents\MATLAB\project\VIoutput.txt','w'); % Create the The text file To stored the VI values
fprintf(fileid,'%d',Vrange); % Storing the VI values in text File
  • METHOD 3: Project name--VIproject.m (Attachments--VIproject_output_curve.fig & VIproject_output.txt)
clear all
close all
clc
VI=xlsread('C:\Users\Nikhil\Documents\MATLAB\project\VI.xlsx'); % Read the of Voltage and current from given excel File.
V=VI(:,1); % Load the given Voltage Value (row 1)
I=VI(:,2); % Load the Given Current Value (row 2)
Range=-17.3:0.1:0.9; % Define the Range of voltage Between -17.3 to 0.9 with 0.1 Interval
Range_interpol=interp1(V,I,Range,'linear'); % Using Interpolation to find the missing Values Between the range
subplot(211);
plot(Range,Range_interpol);
title('Current and voltage data of laboratory in specified range');
xlabel('Volt'); ylabel('Ampere');
VV=[-17.2 -13 -11 -9 -6 -1 0.11 0.25 0.5 0.61 0.66 ]; % 11 Given Voltage Values from Excel sheet
V_interpol=interp1(V,I,VV,'linear'); % Using Interpolation To find the missing variables of Given 11 voltage Values.
subplot(212);
plot(VV,V_interpol);
title('11 voltage values from excel sheet');
xlabel('Volt'); ylabel('Ampere');
fileid=fopen('VI.txt','w'); % Create the The text file To stored the VI values
fprintf(fileid,'%d %f\n',Range); % Storing the VI values in text File
fclose(fileid);
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.