Solving an equation. use fsolve, root, solve?

4 Ansichten (letzte 30 Tage)
toner
toner am 19 Okt. 2013
Beantwortet: Walter Roberson am 19 Okt. 2013
Hey there I'm having a lot of trouble doing something that I imagine is very simple. I'm trying to solve an equation, trying to solve for a variable.
The code I am working with is here:
syms Msub
gamma = 1.4;
solve(0.0525/0.0200 = (1/Msub)*((2/(gamma+1))*(1+((gamma-1)/2)*Msub^2))^((gamma+1)/(2*(gamma-1)), Msub)
how can I obtain the two values for Msub!? I keep getting the error "The expression to the left of the equals sign is not a valid target for an assignment."

Antworten (1)

Walter Roberson
Walter Roberson am 19 Okt. 2013
You are using an older version of MATLAB that does not support using "=" between symbols to indicate a equation. Convert to
solve( (-0.0525/0.0200) + (1/Msub)*((2/(gamma+1))*(1+((gamma-1)/2)*Msub^2))^((gamma+1)/(2*(gamma-1)), Msub)
That is, A=B can be converted to A-B=0 or (-A)+B=0

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by