Changing the derivative variable in symbolic matlab
1 回表示 (過去 30 日間)
古いコメントを表示
How can i preform the derivative of a symbolic Matrix in repect to every variable in the equation
in other words: if i have a symbolic Matrix (3x3) which in a function of x1,x2,x3...
how can i calculate dM(1,1)/dx1,dM(1,1)/dx2,dM(1,1)/dx3,...dM(1,2)/dx1,dM(1,2)/dx2,... etc.
just to clarify the matrix M is a symbolic matrix and x1,x2,x3... are symbolic varibles.
Thanks in advance.
0 件のコメント
回答 (1 件)
Aghamarsh Varanasi
2021 年 5 月 27 日
Hi,
If the symbolic matrix be stored in a variable 'M', the function 'diff' can be used to get the partial derivative of the matrix 'M'. For Example, M is a Symbolic Matrix of symbolic variables x1, x2 and x3.
Mdx1 = diff(M,x1);
This will give the partial differential of the matrix with respect to x1 i.e, Mdx1(1,1) = dM(1,1)/dx1, Mdx1(1,2) = dM(1,2)/dx1 etc.
You can similarly partially differentiate the matrix 'M' with respect to other symbolic variables x2 and x3.
Hope this helps
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!