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.

  1. Read about MatLAb on Wikipedia: https://en.wikipedia.org/wiki/MATLAB. Write any 5 unique points about MATLAB.
  2. What do the commands "spy" and "why" achieve in matlab?
  3. Write code that generates 10 random numbers. Submit your code
  4. 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.
  5. What does the magic command do ?
  6. 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)
  7. Using the matrix generated from above, write code that prints the first two rows and the last 4 columns.
  8. Loop through the matrix and find the square root of each matrix element
  9. Learn some cool trick in Matlab and share it for extra marks.