How can I calculate the first derivative of a vector with respect to a matrix?

조회 수: 1 (최근 30일)
I have x = a*B*C, where x is 1*4 vector, a is 1*2 vector, B is 2*4 matrix, and C is 4*4 matrix.
How can I calculate the first derivative of the vector x with respect to matrix B?

채택된 답변

Walter Roberson
Walter Roberson 2020년 5월 20일
syms a [1 2]
syms B [2 4]
syms C [4 4]
x = a*B*C;
derivs = arrayfun(@(X) reshape(gradient(X, B(:)),size(B)), x, 'uniform', 0);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by