I saw this exercise on Coursera and seemed to have solved it, anyway when I ran the code it worked, but when I submit the answer and it is evaluated with random input, I get an error message every time. When I try to run it with the random numbers that were used for the evaluation, I get the correct results. Does anyone have the same problem? This is my code:
function [mmr, mmm] = minimax(M)
mmr = (max(M,,2)-min(M,,2))'
mmm = max(M(:))