Starting from:

$29.99

Assignment I- assign values to variable

ECE-210-A Assignment I

In this assignment, you will employ the basic skills you learned in the first week of class; you
will assign values to variables, use some of MATLAB’s basic functions, and perform some simple
arithmetic operations on scalars and matrices. You should also use this assignment as a way to get
comfortable with the help and doc functions. For your final submission, as always, please suppress
all outputs with semicolons. It may be good to get into the habit of beginning your scripts with
clc, clear and close all. Don’t remember what these do? Use help!
1. Create four scalar variables with the values:
• ln(9)
• arcsin(e
−9
) × 104
• log10(

9
)
• 9 + j
Give these variables reasonable and unique names! Then make a column vector containing each of
these four values in order as entries. Do this using variable names, i.e. don’t just copy and paste
the mathematical expressions.
2. Compute the real part, imaginary part, magnitude and phase of the complex variable from
Question 1. Store these four values as variables, then create a row vector with these values as
entries. Once again, do this using variable names.
3. You now have two vectors of length 4, but one is a row vector and one is a column vector.
Multiply these two vectors in both orders, giving you two arrays of different sizes. Store these
values in variables.
4. Still using the vectors from Questions 1 and 2, transpose one of them so that both are column
vectors (be sure to only conduct the regular transpose, not conjugate transpose). Now find the
elementwise product of these two vectors, which will itself be a length 4 column vector. Using
repmat, create a 4x4 matrix whose columns are each this vector.
5. From Questions 3 and 4 you should have two 4x4 matrices. Perform the following operations on
these matrices and store the outputs as variables:
• Matrix multipliplication in either order
• Elementwise multiplication
• Conjugate transpose of either matrix
• Inverse of the sum of either matrix with the 4x4 identity
• Square of either matrix
1
6. One of your vector multiplies from Question 3 should have given you a complex scalar. Use the
MATLAB function fix (use doc to see exactly what this does) to round down the real part of this
value. Store this natural number as a variable called n. Create two vectors: one containing 1000
evenly spaced points between 1 and n, the second containing values between 1 and n spaced in
intervals of size 0.1. Use the more natural of the colon operator or linspace to create these vectors;
you should wind up using both!
2

More products