Filter löschen
Filter löschen

Jacoabian doesn't work

2 Ansichten (letzte 30 Tage)
Kim O
Kim O am 20 Mai 2012
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 Kommentare
Walter Roberson
Walter Roberson am 20 Mai 2012
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 am 20 Mai 2012
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!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Mai 2012
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)

Weitere Antworten (1)

Kim O
Kim O am 20 Mai 2012
PERFECT simple solution :) Works fine. Thank You!

Kategorien

Mehr zu Get Started with MuPAD finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by