Using symbolic matrix operations correctly?
이전 댓글 표시
I am new to symbolic computations in MATLAB and am trying out matrix differentiations.
If we take derivative of trace(X*A) w.r.t. X, we should get A^T.
But MATLAB tells me
>> syms X A;
>> diff(trace(X*A), X)
ans =
A
Where am I wrong?
채택된 답변
추가 답변 (2개)
Andrei Bobrov
2016년 7월 27일
reshape(jacobian(trace(A.*X),X(:)),size(A))
Azzi Abdelmalek
2016년 7월 27일
A is not defined as a symbolic matrix.
A=sym('a',5)
syms x
diff(trace(x*A),x)
카테고리
도움말 센터 및 File Exchange에서 Operations on Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!