1.1) What is the result of:
- a+b
- a*b
- *b where βaβ and βbβ are column vectors
1.2) Repeat 1.1 but with βaβ as a matrix
Turn in your answer.
Problem 2:
Plot following functions in the same plot (overlay)
π¦1 = cos(π‘) π¦2 = sin(π‘)
where βtβ is a vector from 0 to 50 with the increasing step:
- 1
- 01
Do the signals look smoother when we reduce the increasing step? Turn in your answer, plots, and codes.
Problem 3:
Write a program to solve the system of equations of three variables using the matrix inverse method. The program should include user prompt to input equation coefficients. The general form of a three-variable equation isΒ ππ₯ + ππ¦ + ππ§ = π. Assume that the users have to give the coefficients in the order βaβ, βbβ, βcβ, and βdβ. Test your program with the following system of equations:
2π₯ + 3π¦ + π§ = 3
π₯ + 3π¦ β π§ = 6
2π₯ + 2π¦ = 7
Turn in your code and result from the Matlab command window.
Hints: Note that from Linear Algebra theory, you can solve the system of equations using matrix inverse method by the following steps:
Step 1: Rearrange the equations so that all of them have the form of ππ₯ + ππ¦ + ππ§ = π
Step 2: Write the equations in matrix form π΄ β π‘ = π
Step 3: The result is π‘ = π΄β1 β π
π΄β1 is the inverse matrix of A and could be computed in Matlab by using the command inv(A).
Problem 4:
Write an M-file program to calculate:
Β
where βlogβ is the natural logarithm function, βsignβ is the signum function.
The program must include a user prompt to input the parameter βΒ΅β and input βxβ. Note that βxβ can be either a scalar number or a vector. The above equation shows the input-output characteristic of a Β΅-law compressor used in pulse-code modulation (PCM).
Test your program by plotting βyβ according to βxβ. Let Β΅=255 and βxβ is a vector changing from 0 to 1 with the increasing step 0.01. Turn in your code and plot. Keep a copy of your code, you will need it later.



