Why is this function not recognizing the correct number of rows?
Afficher commentaires plus anciens
In this function I am taking a matrix m where each row holds a student's grades and each column is a different assignment, and returning the lowest of the highest grade that each student achieved in any assignment. When I do minmaxgrade([74, 72, 78; 67, 89, 90; 89, 92, 100; 100, 80, 90]) I am getting a weird answer, ans = 67 72 78 instead of just 78.
Here's my code:
function M=minmaxgrade(m)
[R,~]=size(m);
M=min(max(m,[],R));
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical 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!