How to substitute symbolic Jacobian of a multivariate function, D(f)(x)?

4 ビュー (過去 30 日間)
JCL
JCL 2019 年 10 月 8 日
回答済み: Jyothis Gireesh 2019 年 10 月 11 日
Hi, I have the following sample code:
syms x y z fun(omega) dfun
star = x^2 - x*y*z;
fx = fun(star);
Jacobian = jacobian(fx,[x,y,z]);
lookup_dfun = subs('D(fun)(star)','star',star);
for j=1:size(Jacobian,2)
tmp = Jacobian(j);
tmp = subs(tmp,lookup_dfun,dfun);
Jacobian(j) = tmp;
end
The problem is that when I want to substitute 'D(fun)(star)' into lookup_dfun to replace it later into the symbolic Jacobian (since I will assign the value of this derivative later through 'dfun') I get the following error:
Error using subs
Expected input number 1, S, to be one of these types:
sym
Error in sym/subs (line 60)
validateattributes(F, {'sym'}, {}, 'subs', 'S', 1);
Thanks for your help!

回答 (1 件)

Jyothis Gireesh
Jyothis Gireesh 2019 年 10 月 11 日
Please go through the following MATLAB Answer which addresses a similar issue

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by