How do i find the x value for a GIVEN x

1 visualización (últimos 30 días)
Nora Ahmed
Nora Ahmed el 15 de Sept. de 2019
Comentada: Nora Ahmed el 15 de Sept. de 2019
I made a secant script for the function f = @(x) exp(1)/3*x*exp(-x/3) aslo read as (e/3)*x*e^(-x/3). How do i find the x value corisponding to y= .25. I must make a second script. I graphed the fuction on my computer and it is not a root so how do i go about this issue? I know its 11.08 but how do i write it in code?

Respuestas (1)

madhan ravi
madhan ravi el 15 de Sept. de 2019
fsolve(@(x)f(x)-.25,[0,10]) % two solutions but look into you're area of interest
fplot(@(x)f(x)-.25,[0,11])
  2 comentarios
madhan ravi
madhan ravi el 15 de Sept. de 2019
If you have optimisation toolbox use fsolve() else use fzero()
Nora Ahmed
Nora Ahmed el 15 de Sept. de 2019
In my code I used the funtion [p,conv]=secant(f,p0,p1,TOL,max_iter) with sucessful convergence =1 and no convergence =0 i know this method is used to find roots using two points. however rather than finding f(x)=0 i need f(x)=.25 using this menthod and not the > fzero(@(x)f(x)-.25,[-1,1]) if we plotted a f(x)=.25 then we would get two points where it would intersect. I am just lost on how to go about this issue.

Iniciar sesión para comentar.

Categorías

Más información sobre Graph and Network Algorithms 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