[code that does not change the question snipped]
M = M';
What is M = M';?
[code that does not change the question snipped]
M = M';
What is M = M';?
Note that ' is the CTRANSPOSE operator in MATLAB. If you don't want the complex conjugate, use .' which is the TRANSPOSE method.