Trigonometri Problems at atand and acosd

1 次查看(过去 30 天)
Hi.. can you help me pls.. I have a problem :
54.8=acosd(20/(100-z))-atand(40/(500-z))
how to evaluate z at matlab? thanks..

采纳的回答

Matt Fig
Matt Fig 2012-10-18
编辑:Matt Fig 2012-10-18
This is perfect for the FZERO function....
fzero(@(z) 54.8-acosd(20./(100-z))+atand(40./(500-z)),30)
  4 个评论
Walter Roberson
Walter Roberson 2012-10-18
Caution: the above will only find a single solution at most, but there are two solutions (I say "at most" because there are two singularities and you need to watch out for the possibility that your guess is on the far side of a singularity from a solution.)
Matt Fig
Matt Fig 2012-10-18
Yes, Walter is correct. To see good initial guesses (and also a bad initial guess) for the solutions, look where the black line crosses the blue line:
x = 0:.01:500;
f = @(z) 54.8-acosd(20./(100-z))+atand(40./(500-z));
plot(x,f(x))
line([0 500],[0 0],'color','k')

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2012-10-18
You can use the symbolic toolbox if you have it.
Otherwise, rewrite the expression by subtracting the left-hand side from both sides, and then using a zero finder.
Note: there is more than one solution.

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by