Find the Jacobian of a matrix

25 ビュー (過去 30 日間)
Ribal Abi Raad
Ribal Abi Raad 2016 年 12 月 2 日
回答済み: bio lim 2016 年 12 月 2 日
I have a symbolic 3x2 matrix call it fx and I would like to find the derivatives of that matrix with respect to two variables. Which means I will get 2 3x2 matrices where the first matrix is a 3x2 is the derivatives with respect to the first variable and the second matrix is the derivative with respect to the second variable, so a 3x2x2 matrix.
Assume x = [a,b] and I am doing jacobian(fx, x), yet fx has to be a vector or a scalar. I tried reshape as well, and it also did not work.
Thank you for your time.

回答 (1 件)

bio lim
bio lim 2016 年 12 月 2 日
I don't think that would be called " Jacobian matrix " anymore.
What if you do it like this?
syms a b
yourMat = [a*a b+a;
b^2 a^2+b^2;
a b];
newMat{1} = diff(yourMat, a);
newMat{2} = diff(yourMat, b);
Output:
>> newMat{1}
ans =
[ 2*a, 1]
[ 0, 2*a]
[ 1, 0]
>> newMat{2}
ans =
[ 0, 1]
[ 2*b, 2*b]
[ 0, 1]

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by