Finding jacobian of a matrix

조회 수: 198 (최근 30일)
Tinkul
Tinkul 2013년 2월 17일
How to find jacobian of a matrix. I am trying to find out the jacobian of the following but still unable..
[J W] = jacobian(x,z) where z=ones(m,1) x is any matrix.
There are two variables J and W.How to find out the value of J and W manually

답변 (1개)

Carlos
Carlos 2013년 2월 18일
The jacobian command calculates symbollically the jacobian of a given matrix.
The following example can be found in the Mathworks symbolic toolbox user's guide
syms r l f
x = r*cos(l)*cos(f); y = r*cos(l)*sin(f); z = r*sin(l);
J = jacobian([x; y; z], [r l f])
This code yields the following result
J =
[ cos(l)*cos(f), -r*sin(l)*cos(f), -r*cos(l)*sin(f)]
As you can infer from the explanation, the second argument of the command jacobian is a vector containing the symbolic variables of your matrix (not a numeric vector). Once you calculate the symbolic expression of the Jacobian of the given matrix, you can find the numeric value of the Jacobian matrix using the subs command.In this case if r l and f have a value of 1, we can do:
J=subs(J,{r,l,f},{ones(3,1)},0);

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by