two x solutions graphical how can i restrict the range?

Hi guys,
I have an equation to solve for which involves finding the x solution for a certain y value. However for that y value there are two or more solutions. However I know that the x solution should be greater than i.e. x>2 (which is the correct solution). How do I restrict the function in mat lab to give me x>2?
Would anyone know how to do this?
Any help would be appreciated.

6 comentarios

try to read a new variable like 't' and for loop x > 2..,t=x;
How are you finding the solution at present?
sarah
sarah el 12 de Jun. de 2015
Currently I'm using solve function to solve for the equation. The solve function gives me four solutions one complex solution, and 2 others but I would like it to only give me specific one (which i know is the correct answer).
Assuming you are using "solve" in the form
sol = solve(f(x) == 0,x)
just take
sol = sol.x(sol.x > 2);
sarah
sarah el 13 de Jun. de 2015
Thanks so much David.
Be a bit careful there, ">" can ignore the complex part.
sol.x(imag(sol.x)==0 & sol.x>2))

Iniciar sesión para comentar.

Respuestas (0)

Productos

Preguntada:

el 12 de Jun. de 2015

Comentada:

el 13 de Jun. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by