Docsity

MATLAB tasks solved answers, Exercises of Matlab skills

Toggle sidebar
bg1
Corner Case
Write a function called corners that takes a matrix as an input argument and returns four
outputs: the elements at its four corners in this order: top_left, top_right, bottom_left and
bottom_right. (Note that loops and if-statements are neither necessary nor allowed as we
have not covered them yet.) See an example run below:
>> [a, b, c, d] = corners([1 2; 3 4])
a =
1
b =
2
c =
3
d =
4

Partial preview of the text

Download MATLAB tasks solved answers and more Exercises Matlab skills in PDF only on Docsity!

Corner Case Write a function called corners that takes a matrix as an input argument and returns four outputs: the elements at its four corners in this order: top_left , top_right , bottom_left and bottom_right. (Note that loops and if-statements are neither necessary nor allowed as we have not covered them yet.) See an example run below:

[a, b, c, d] = corners([1 2; 3 4]) a = 1 b = 2 c = 3 d = 4