How do I solve this please? Write a function called 'corners' that takes a matrix as an input argument and returns four outputs
Show older comments
The elements at its corners in the order: 'top_left', 'top_right', 'bottom_left', 'bottom_right'. Without loops and if-statements.
An exact copy of how my code looks in the editor is below. My problem is I don't know how to test with random values in my command window. I don't know how it should be written. I'm a total beginner here though.
function [top_left, top_right, bottom_left, bottom_right]=corners(C)
top_left = C(1,1);
top_right = C(end,1);
bottom_left= C(1, end);
bottom_right = C(end,end);
end.
Accepted Answer
More Answers (0)
Categories
Find more on Antennas, Microphones, and Sonar Transducers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!