0% found this document useful (0 votes)
42 views8 pages

Lab Report 2: MATLAB Clayton Hatfield December 1, 2020

This lab report discusses Clayton Hatfield's work learning MATLAB. The goal was to become familiar with MATLAB and do basic equation solving. Clayton defined variables, calculated power from voltage and current, and took measurements by plotting voltage, current, and power over time with varying time steps. Clayton also solved a system of three equations and concluded that MATLAB will be helpful for electrical engineering work by allowing easy testing and viewing of circuit outputs.

Uploaded by

api-534904948
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views8 pages

Lab Report 2: MATLAB Clayton Hatfield December 1, 2020

This lab report discusses Clayton Hatfield's work learning MATLAB. The goal was to become familiar with MATLAB and do basic equation solving. Clayton defined variables, calculated power from voltage and current, and took measurements by plotting voltage, current, and power over time with varying time steps. Clayton also solved a system of three equations and concluded that MATLAB will be helpful for electrical engineering work by allowing easy testing and viewing of circuit outputs.

Uploaded by

api-534904948
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Lab Report 2: MATLAB

Clayton Hatfield
December 1, 2020
Introduction:
The goal of this lab was to become familiar with MATLAB and be able to do basic

equation solving.

Procedure:

When beginning the lab, the first thing that I had to do was log into Vlab and open

MATLAB using the link provided to us. Once MATLAB was open we created a new script

under the name of lab2.m. Three variables were then to be defined, those variables were:

Voltage, Current, and Power. The values that correspond with those variables are: 3,4 and

(Voltage x Current). We then had to have MATLAB display the Power value.

A new variable was added to the script being “t” which represents a time vector being:

 t = 0:0.1:10;

Voltage and Current were then redefined to be the following:

 Voltage = √2×120cos(2πft)

 Current = √2×120cos(2πft+θ)

We then had to take these new values and plot them in various ways involving the change of

the time steps being .5, .01, and .001 and see how this affects our plots. The last step is to plot all

three variables (voltage, current, and power) on the same plot.

The last part of this lab was to solve the following system of equations:

a) 3x+4y-4z=2;
b) -7x+y+z=5;
c) 6x+3y-z=0;
Calculations:

For this lab, one of the first calculations that I had to do within MATLAB was to find the

first power by using the first voltage and current variables that were given in the first section of

the procedure:

Measurements:

Throughout this lab there were a lot of measurements that I had to take in the form of

plots. The first plot that I made was the power in respect to the voltage and current.

Note: For all the graphs below, use the following legend as a reference: Voltage:
Current:
As well as the X-axis in the time, Y-axis is the value.
Power:

Power Plot 1 with t step = 0.1


Power Plot 2 with t step = 0.5

Power Plot 3 with t step = 0.01

Power Plot 4 with t step = 0.001


VC Plot 1 with t step = 0.1

VC Plot 2 with t step = 0.5

VC Plot 3 with t step = 0.01


VC Plot 4 with t step = 0.001

The last part of this lab was to be able to solve the system of equations that was given to

us within the lab. Using the code that is found after the conclusion in the appendix section I was

able to output the following values:


Questions:

1. Explain the MATLAB API and what the main parts of MATLAB are in a few short sentences. 

- MATLABS API is very useful when accessing features or trying to view data. MATLAB
allows us to easily view functions and their outputs using simple commands while easily
defining variables that we want to test and view.

2. How useful was the MathWorks help when navigating new functions? 

- I found MathWorks helpful once I figured out where to go in order to find the answers to
my question as it was tricky for me at first.

3. How did you find MATLAB to be different from other programming languages you have used?

- I feel that MATLAB is a smoother programming language for computations and there are
some parts of it that feel like R-Studio which I use for my Stats-310 class that I am taking
now.

Conclusion:

MATLAB is going to be very helpful to me as an electrical engineer once I get more

comfortable with the language itself and its functions. This will allow me to easily test circuits

and view the outputs in a simple and easy to understand plot. Finding the power function while

also being able to view the power and current as sinusoidal waves will be extremely helpful. I

also believe that this tool, MATLAB, would be faster than measuring the actual values of the

circuit and would enhance the analysis process of a circuit.


My Code:

You might also like