This preview shows pages 1–3. Sign up to view the full content.
ECE 101 – Linear Systems, Winter 2008
Lab #1 Solutions
January 17, 2008
(send questions/comments to [email protected])
Problem 1
. The plot for the message is shown below:
Problem 2
. The plot for the message is shown below:
The multiply should be done with an array multiplication.
The vectors (
M
9000) and (
K
+
C
)
need to be multiplied elementbyelement, which is array multiplication (
.*
).
Matrix
multiplication (
*
) would result in a dot product, i.e., a single number.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document Problem 3
.
((2 + j5) (1  j5)) / ((1 + j7) (3 + j2)) =
–0.634 – 0.871j
=
1.077e
2.200j
Problem 4
.
z = r(n)e
jn
where r(n) = 1 – sin(n), n
∈
[0, 2
π
]. The plot below shows the real and
imaginary parts on separate axes:
The plot can also be done in the complex plane:
Problem 5
.
For the
half
and
twice
functions, loops can be avoided by using the colon operator
(
:
), along with the
end
keyword.
For example, given a vector X, one can obtain only the odd
indexed elements by using “X(1:2:end)”.
This command says to take the vector X, start at the
first element (indexed by 1), go to the end of the vector, and take every 2 elements.
Thus,
Matlab will select elements 1, 3, 5, … up to the end of the vector X.
In Matlab, loops are slower
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 03/16/2009 for the course ECE 101 taught by Professor Siegel during the Fall '08 term at UCSD.
 Fall '08
 Siegel

Click to edit the document details