Orientation 2017: MATLAB Assignment
by Aggrey Muhebwa and Danny Habamwabo.
Note: This is an optional assignement and should be used as an exercise to spark discussions
with students and TAs. Please do NOT submit this.
-
Read about MatLAb on Wikipedia:
https://en.wikipedia.org/wiki/MATLAB. Write any 5 unique points about MATLAB.
- What do the commands "spy" and "why" achieve in matlab?
- Write code that generates 10 random numbers. Submit your code
- Plot a graph of x against y where
X ranges from 0 to 2 *Pi in the increment of Pi/100 (x = 0:Pi/100:2Pi)
Y = sin(x) + 2 cos(x)
Take a screenshot of your graph and send it with the .m files.
- What does the magic command do ?
- Create a matrix with 6 rows by 6 columns where the sum of each row equals the sum of each columns( if you add elements in any row/column, the answer should be the same)
- Using the matrix generated from above, write code that prints the first two rows and the last 4 columns.
- Loop through the matrix and find the square root of each matrix element
- Learn some cool trick in Matlab and share it for extra marks.