0% found this document useful (0 votes)
51 views4 pages

EE421/Lab 03 Visualization and Programming: - O + X S D V P N

The document provides instructions for a lab exercise on plotting and programming in MATLAB. It includes: 1) A table showing different plot symbols and line styles that can be used in MATLAB plots. 2) Instructions on how to write MATLAB functions to calculate equivalent resistances in series and parallel circuits and how to call these functions. 3) A problem to write a MATLAB program that defines a time vector, calculates a signal using exponential and trigonometric functions, plots the real, imaginary, magnitude and phase components, and plots the signal in 3D. The output should be a vector containing the signal values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

EE421/Lab 03 Visualization and Programming: - O + X S D V P N

The document provides instructions for a lab exercise on plotting and programming in MATLAB. It includes: 1) A table showing different plot symbols and line styles that can be used in MATLAB plots. 2) Instructions on how to write MATLAB functions to calculate equivalent resistances in series and parallel circuits and how to call these functions. 3) A problem to write a MATLAB program that defines a time vector, calculates a signal using exponential and trigonometric functions, plots the real, imaginary, magnitude and phase components, and plots the signal in 3D. The output should be a vector containing the signal values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EE421/Lab 03 Visualization and Programming

Objectives:
We want to practice the use of figures in Matleb. Also, we want acquired
knowledge about how use functions in programming or as user.
Pre_Lab:

I – plotting
In general, on can use the function plot to draw figure owing x, y vectors according to x-axis
and y-axis.
plot(X,Y)
We can add or rectify color dot form and line form according to the table:

Color Name In Matlab dot form In Matlab line form In Matlab

yellow 'y' point . Solid line -


magenta 'm' Circle O Dotted :
line

cyan 'c' Aterisk * dash dotted -.


line

red 'r' plus + Dash line --


green 'g' cross x
blue 'b' square s
white 'w' diamond d
black 'k' Triangle v
down

Triangle ^
up

Triangle <
left

Triangle >
right

pentagram p
hexagram N

II – programing
We can program by using m-file or a function. The function are more powerful in matlab
because it gives chance to take inputs and gives outputs.

In_Lab:
1
EE421/Lab 03 Visualization and Programming

Names group station

=================================================================

I - Plotting
1. Given x intervals and functions, write m-files containing the commands producing the
figures:

Matlab’s command Result

x=0:pi/20:4*pi;

2
EE421/Lab 03 Visualization and Programming

x=0:pi/20:4*pi;

x1=-10:10; x2=(x1)2

II- Programming

1. Write a function named “R_eq” where we can calculate the equivalent of two
resistances. Tacking in consideration (series or parallels)

3
EE421/Lab 03 Visualization and Programming

How can we call the function in these cases?

Circuit Command window’s call

a) (10k //1k)+12k

b) (5k+10k+0.2k)//1k

c) ((2k//10k)+(5k//4k))//120k

2. Write a matlab program in which one can:

1) defines x =[0:0.1:100]
2) calculates 𝑓(𝑥) = exp(−𝐴𝑡 + 𝑗2𝜋𝑓 𝑡)) by taking 𝐴 and 𝑓 as inputs of the
function.
3) plots the real and the complex part , the module and the phase in the same figure
(use real, imag, angel abs and subplot)
4) Plots f(x) in 3D using another figure.
5) The output is the vector Y continuing f(x) values.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy