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
Best Answer