How do I solve this please? Write a function called 'corners' that takes a matrix as an input argument and returns four outputs
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Antennas, Microphones, and Sonar Transducers dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!