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

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

This occurs if M is a two dimensional matrix.
If this is the case, then maxM and minM will actually be rows of M, 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
maxM = max(M(:))
minM = min(M(:))
...and as PengOne said, / (instead of ./) should do just fine in this case.
Related question: