Escolar Documentos
Profissional Documentos
Cultura Documentos
ECNG 1006
MATLAB EXERCISE
EXERCISE 1
Array and Matrix Operations
Operations
Contents
1.
2.
3.
In-Lab ...................................................................................................................................... 4
ECNG 1006
Lab and Project Design I
http://myelearning.sta.uwi.edu/
Semester II; 2008 / 2009
1. GENERAL INFORMATION
Lab #:
Name of the Lab:
Lab Weighting:
5%
Delivery mode:
Lab:
SHARED LAB
Lab Dependencies
Recommended
prior knowledge
and skills:
Course Staff
Yes
Position/Role
Course Lecturer
Ronald.DeFour@sta.uwi.edu
Juliet Romeo-Joseph
Juliet.Romeo@sta.uwi.edu
Adelle Joseph
Course Coordinator
Adelle.Joseph@sta.uwi.edu
Azim Abdool
Lab Demonstrator
Azim.Abdool@sta.uwi.edu
Cognitive
Level
Application
3. IN-LAB
Allotted Completion 3 hours
Time:
1 PC with MATLAB version 6.5 or higher
Required lab
Equipment:
3 7 4 12
5 9 10 2
A=
6 13 8 11
15 5 4 1
3.1.2
12 2
4 9
3 9
C=
8
6
a. Find A + B + C
b. Find A - B + C
c. Verify the associative law
(A + B) + C = A + (B + C)
b. AB where:
7 4
A = 3 2
5 9
1 8
B=
7 6
6 2
A=
10 3
8
9
B=
12 14
ax1 + bx2 = c
dx1 + ex2 = f
can be represented in the following compact form of Ax = y where
x
x = 1
x2
a b
A=
d e
and
a.
2x + 9 y = 5
3x 4 y = 7
b.
3x 4 y = 5
6 x 10 y = 2
c.
3 x + 2 y 9 z = 65
9 x 5 y + 2 z = 16
6 x + 7 y + 3z = 5
d.
[x1
62
x2 ] = [3 19]
35
c
y=
f
3.2.2 The above problems may be solved using the left division method \. Use MATLAB help
to find out more on this and repeat a, b and c using the left division method.
3.3. Polynomials
Polynomials are usually described using the following notation:
f ( x) = a1 x n + a 2 x n1 + a3 x n 2 + K + a n x + a n+1
where the polynomial is a function of x and n is the highest order or power of the polynomial.
Polynomials can be described as row vectors in MATLAB starting with the highest power of x.
For example:
f ( x) = ax 3 + bx 2 + cx + d
may be represented in MATLAB by the coefficient array:
f = [ a , b, c , d ]
3.3.1 Use MATLAB help to find out about the conv and deconv commands to perform
polynomial products and divisions.
a. For:
f ( x) = 9 x 3 5 x 2 + 3x + 7
Find f(x)g(x) and
and
f ( x)
g ( x)
b. Find
(20 x 3 7 x 2 + 5 x + 10)(4 x 2 + 12 x 3)
g ( x) = 6 x 2 x + 2
3.3.2 Use MATLAB help to find out about the roots command to find the roots of a polynomial
when f(x) = 0.
3.4.2 For y = tan(x) and z = sec(x), where x are values between 0 and 1 in increments of 0.01,
plot y and z on the same figure. Let the plot of y be a red line with x points and let the plot of z
be a dashed green line with o points.
3.4.3 Use MATLAB help to find out about the subplot command.
Using the subplot command, plot:
a. y = e 1.2 x sin(10 x + 5) for 0 < x < 5
b. y = x 3 100 for -6 < x < 6
For a sinusoidal input at vi, the Input / Output ratio (Ao/Ai) of the low pass filter shown in the
figure below is given by the expression:
Ao
1
=
Ai RCs + 1
where s = i. For RC = 0.1 sec, obtain the loglog plot of |Ao/Ai| versus .
(Hint: s = [1:100]*i. Use the imag and loglog MATLAB commands).
Due Date:
Submission
Procedure:
Deliverables: