フィルターのクリア

Jacoabian doesn't work

2 ビュー (過去 30 日間)
Kim O
Kim O 2012 年 5 月 20 日
Hello,
I want to calculate
J=jacobian(f_algebr, yss);
But I get Errors. I uploaded my mat file so you can see what f_algebr and yss is.
Thank you
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 5 月 20 日
It is faster for us if you tell us what the error message _is_ and which line of code it is on, and if you show us size() and class() of your variables.
Kim O
Kim O 2012 年 5 月 20 日
Hi Walter, you are the only one who is answering me. Thank you! :)
Ok here is the error message:
Error using mupadmex
Error in MuPAD command: Invalid variable. [stdlib::diff]
Error in sym/jacobian (line 33)
Jsym = mupadmex('symobj::jacobian',F.s,x.s);
Error in geosim (line 195)
Jac=jacobian(f_algebr, yss);
%---------------------structure of my variables
f_algebr=[exp(x(9)-x(7) ); x(8)*sin(t) ; ....and so on.....]; % ==> : 13x1 sym
yss=[ x(7), x(8), x(9)]; % ==> 1x3 sym
I think matlab has problems with detecting x(*) as a variable in f_algebr...but I don't know how to solve this problem
Thank you Walter for helping me!

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2012 年 5 月 20 日
In MuPAD, x(7) is to invoke the function x with argument 7. x[7] would be used to index the vector x at its 7th element.
The simplest way to resolve your difficulty would be to subs() variable names such as x1 for x(1)

その他の回答 (1 件)

Kim O
Kim O 2012 年 5 月 20 日
PERFECT simple solution :) Works fine. Thank You!

カテゴリ

Help Center および File ExchangeGet Started with MuPAD についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by