필터 지우기
필터 지우기

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 CenterFile Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by