Feb 6, 2008 #1 F 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
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
Feb 6, 2008 #2 B brmadhukar Advanced Member level 3 Joined Jun 21, 2002 Messages 839 Helped 42 Reputation 84 Reaction score 11 Trophy points 1,298 Location India Activity points 6,783 why dont you just sweep x and see the output in matlab
Feb 7, 2008 #3 F 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 brmadhukar said: why dont you just sweep x and see the output in matlab Click to expand... 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
brmadhukar said: why dont you just sweep x and see the output in matlab Click to expand... 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
Feb 7, 2008 #4 I ieropsaltic Full Member level 4 Joined Sep 25, 2006 Messages 199 Helped 64 Reputation 128 Reaction score 18 Trophy points 1,298 Activity points 2,595 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/
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/