Solving an equation. use fsolve, root, solve?

4 visualizaciones (últimos 30 días)
toner
toner el 19 de Oct. de 2013
Respondida: Walter Roberson el 19 de Oct. de 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."

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Oct. de 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

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by