MATLAB Assignment 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

EEL3000 – MATLAB Assignment 1

1. Compute: Find the results of each of the following expressions.


5
(289)2 −(107)3
a. 2 − 100
(3√158)
−1
b. cot (ln⁡(4𝑒 9 ))
1 14+𝑒 1.609437
c. +
log2 ((1024)2 ) 20

2. Using Pi: Given that you have a tesseract (the four-dimensional cube), calculate the
volume given that its side length, s, is equal to pi.
(Volume of Hypercubes: 𝑉 = 𝑠 𝐷 ; ⁡𝑤ℎ𝑒𝑟𝑒⁡𝐷⁡𝑖𝑠⁡𝑡ℎ𝑒⁡𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛⁡𝑎𝑛𝑑⁡𝑠⁡𝑖𝑠⁡𝑠𝑖𝑑𝑒⁡𝑙𝑒𝑛𝑔𝑡ℎ)

3. Arrays: Consider the equation:


𝑎
𝑏=3
√𝑎
Use the following array values of a to yield an array of b values: 𝑎 = 2, 4, 6, 8, 10
4. Complex Numbers: From 𝒒 = 𝟕 + 𝟏𝒋, find the following using built-in functions:
a. Real Part
b. Imaginary Part
c. Absolute Value
d. Phase
e. Complex Conjugate

5. Using “help” and Plotting Graphs: Read about the meshgrid and surf functions and
reference the built-in examples. This can be done by typing help surf or help meshgrid
Given that −𝟐. 𝟓 ≤ 𝒙 ≤ 𝟐. 𝟓 and −𝟐. 𝟓 ≤ 𝒚 ≤ 𝟐. 𝟓, use these functions to create a
surface plot for 𝒛 = 𝒔𝒊𝒏(𝒙𝟐 + 𝒚𝟐 ).⁡Make sure you choose enough points for x and y to
make the curve smooth.

6. Matrices: Given the matrices:


8 1 7 −5 0 −6 −2 −3 2
𝑋 = [10 9 8] ⁡⁡⁡⁡⁡𝑌 = [−2 −3 −6] ⁡⁡⁡⁡⁡⁡𝑍 = [ 1 −1 −3]
7 10 8 −7 −3 −1 4 1 5
Evaluate the following expressions:
a. 𝑋−𝑌
b. 𝑋𝑇 + 𝑌𝑇 − 𝑍𝑇
c. Determinant of 𝑌
d. Element-wise Multiplication of 𝑋 and 𝑍
e. Multiplication of 𝑌 and 𝑍
7. Solving Systems: Solve the following system of equations using matrices.
𝟑𝒙 − 𝒚 + 𝟕𝒛 = 𝟗
−𝟒𝒙 + 𝟓𝒚 − 𝒛 = −𝟐
𝟕𝒚 + 𝟏𝟏𝒛 = 𝟖
8. Complex Arithmetic: Given the complex numbers:
𝒂 = 𝟓. 𝟓 + 𝟐. 𝟓𝒋⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝒃 = −𝟐 − 𝟏𝒋⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝒄 = 𝟏𝟏 + 𝟔𝒋
Evaluate the following expressions:
𝑐
a. 𝑎𝑏
𝑎+𝑏
b. 𝑐−𝑎
c. (𝑎𝑏𝑐 − 𝑎 + 𝑏𝑐𝑐) ∗ 0.01

9. Graphing: Graph the following functions of the same plot and find the points of
intersection by zooming into the plot and hovering your cursor at the intersection. Make
sure you choose enough points to plot a smooth curve. Label the axes and add a plot title.
Use −𝟏𝟎 ≤ 𝒙 ≤ 𝟏𝟎. It might help to use ylim([-100,100]) when viewing.
𝒚𝟏 = 𝟓(𝒙 − 𝟓)𝟑
𝒚𝟐 = 𝟎. 𝟐𝒙 + 𝟑. 𝟖
𝒚𝟑 = (𝒙 − 𝟒)𝟐 + 𝟏
10. Values: Find the minimum and maximum of each matrix or vector below using built in
functions.
0
a. [ 2 ]
−1
1 0 −1
b. [0 1 −11]
9 10 1
1 9 10
c. [ ]
−5 11 0

11. Functions
a. Create a function that takes inputs “x”, “y”. The function outputs a matrix with
dimensionality x by y. The values of each element of this matrix will be calculated
by the equation (𝑥𝑖 + 𝑦𝑗 ), where 𝑖 represents the row number and 𝑗 represents the
column number of that element.
b. Create another function that takes in a generic input matrix “z”. Your function
outputs the maximum element value in z raised to the power of the minimum
element value in z.

You might also like