Simplifying symbolic matrix multiplication with e.g. transpose
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Walter Roberson
2018년 1월 14일
0 개 추천
You cannot do that in MATLAB using anything built in. The symbolic toolbox has no data type corresponding to general matrix with nonspecific entries, not even if you were to specify a particular matrix size. The toolbox only has matrices with specific elements, and it always carries out the entire matrix multiplication giving the matrix of formulas where each symbol mentioned is assumed to be a simple scalar subject to commutivity.
The easiest way by far to handle this is to use a different symbolic package. To program this in MATLAB would require digging deep into the symbolic engine representation of objects in a way that is only accessible by programming in mupad.
댓글 수: 2
Kelvin Østergaard Pagels
2018년 1월 14일
Walter Roberson
2018년 1월 14일
Unfortunately at the moment I do not know which packages can handle that. I was going to say Maple or Mathematica, but when I look more closely those appear to have similar difficulties.
Maple at least has a non-commutative matrix multiplication operator distinct from element-by-element multiplication, but in Maple, transpose applied to a symbol assumes that the symbol is scalar, so in Maple, MatrixMatrixMultiply(W,Transpose(W)) is W^2
카테고리
도움말 센터 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!