Trial&Error using matlab

Status
Not open for further replies.

fidobido

Newbie level 6
Joined
Feb 28, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,382
i need a function in matlab to solve trial and error problems such as

Code:
Φ=atan(x)-atan(1/x)
to find the value of x

thanks alot
 

why dont you just sweep x and see the output in matlab
 

brmadhukar said:
why dont you just sweep x and see the output in matlab

i know this solution....but if i don't know the range of x ,it will take long time to know its value
i think there is another method to find it
 

You can try the fzero function.
e.g: a=fzero(Φ-(atan(x)-atan(1/x)),x0); where x0 is a 2 element vector defining the interval at which to search for the solution. You can check its help at mathworks web site:
https://www.mathworks.com/
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…