MATLAB: Simplifying symbolic matrix multiplication with e.g. transpose

matrixmultiplicationsymbolic

Hello
Im strugling with a thing in MATLAB and havent figured out how it can be solved.
How do you tryout math rules like:
(W W^T X)^T * (W W^T X) = X^T W W^T W W^T X
Its not possible to do the following:
syms X W
(W*W'*X)'*(W*W'*X)
transpose((W*transpose(W)*X))*(W*transpose(W)*X)
Which gives: W^4*X^2
or like: (X+W)' = X'+W'.
So to sum up my question: How do you do symbolic math calculations in MATLAB?

Best Answer

To denote transpose with an apostrophe, you need to type it as
syms X W
(W*W.'*X).'*(W*W.'*X)
which will result in
W^4*X^2