Hi I keep getting the error:
>> maxM = max(M);
>> minM = min(M);
>> Mnormalize = ((M-minM)./(maxM-minM) - 0.5 ) *2;
??? Error using ==> minus
Matrix dimensions must agree.
M file looks like this

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This occurs if
Mis a two dimensional matrix.If this is the case, then
maxMandminMwill actually be rows ofM, and it fails due to the fact that you can’t take for instance[1 2; 3 4] - [1 2].If you want the minimum / maximum of the whole matrix, you probably want to do
…and as PengOne said,
/(instead of./) should do just fine in this case.Related question: