what is the syntaxis for numerical solvers?
Afficher commentaires plus anciens
Hi, for the last hour I am trying to start the numerical solver..
The copy-past from "help"
numeric::solve([sin(x) = y^2 - 1, cos(x) = y], [x, y]);
gives
Error: Unexpected MATLAB operator
for '::'
I can also use the other syntaxis option, which works fine in my script:
syms ha r2 positive; [h,rcone] = solve( hh(ha,r2) == 0, VV(ha,r2) == V0);
If use this, how do I define the range of ha and r2 in which I want the solutions?
Réponse acceptée
Plus de réponses (4)
Azzi Abdelmalek
le 12 Déc 2012
Modifié(e) : Azzi Abdelmalek
le 12 Déc 2012
sol=solve('sin(x) = y^2 - 1', 'cos(x) = y')
%or
sol=solve('sin(x) -y^2 + 1', 'cos(x) - y')
2 commentaires
Chibuzo Chukwu
le 13 Déc 2018
How do I make x the subject of this equation.using matlab
x = exp(x+y)
Walter Roberson
le 13 Déc 2018
Modifié(e) : Walter Roberson
le 13 Déc 2018
In older versions of MATLAB,
solve('x = exp(x+y)', 'x')
In more modern versions
syms x y
solve(x == exp(x+y), x)
However, MATLAB is not able to find a solution. A solution exists, and is
-lambertw(-exp(y))
but MATLAB is not strong on Lambert W processing.
Zuhaib
le 12 Déc 2012
0 votes
it depend on your equation .. write function used in your equation for search in hepl of matlab
Walter Roberson
le 12 Déc 2012
numeric::solve is a MuPAD call that cannot be directly used from MATLAB. Use
feval(symengine, 'numeric::solve', [sym('sin(x) = y^2 - 1'), sym('cos(x) = y')], [sym('x'), sym('y')])
If you have R2011b or later (I think it is), you can use
syms x y
feval(symengine, 'numeric::solve', [sin(x) = y^2 - 1, cos(x) = y], [x, y])
1 commentaire
Petr
le 13 Déc 2012
Chibuzo Chukwu
le 13 Déc 2018
0 votes
How do I make x the subject of this equation.using matlab
x = exp(x+y)
Catégories
En savoir plus sur Numeric Solvers dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!