solving an equation in MATLAB

5 visualizaciones (últimos 30 días)
KeJoSa
KeJoSa el 3 de Nov. de 2012
Hi,
I am trying to solve the following equation for q in MATLAB, however, I get a message saying q is not defined.
solve(z1*(K1-1)/(q*(K1-1)+1)+z2*(K2-1)/(q*(K2-1)+1)+z3*(K3-1)/(q*(K3-1)+1)==0,q)

Respuesta aceptada

Matt Fig
Matt Fig el 3 de Nov. de 2012
S = solve('z1*(K1-1)/(q*(K1-1)+1)+z2*(K2-1)/(q*(K2-1)+1)+z3*(K3-1)/(q*(K3-1)+1)','q')

Más respuestas (2)

KeJoSa
KeJoSa el 3 de Nov. de 2012
Thanks Matt!

Walter Roberson
Walter Roberson el 3 de Nov. de 2012
No, the key is to add
syms q
before the call.
Also, as you are not using R2012a or later, you cannot use == in solve(). As you are comparing to 0 anyhow, just leave that part out:
solve(z1*(K1-1)/(q*(K1-1)+1)+z2*(K2-1)/(q*(K2-1)+1)+z3*(K3-1)/(q*(K3-1)+1),q)
  1 comentario
Matt Fig
Matt Fig el 3 de Nov. de 2012
What do you mean, 'No' Walter? The above code works fine on my system....

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by