This is a hard question to google. I am new to Matlab and have seen the following statement, but I can't see how it does anything. What doe x = x(:) do?
x(:) transforms the array to a column vector.
More about the colon operator
This syntax is generally used to ensure that x is a column vector:
x
x = x(:)
Similarly, this line ensures that x is a row vector
x = x(:)'