keep just positive or just negetive answer of acos?

11 次查看(过去 30 天)
I have arccos and I want to keep just negative answer of it? how can I do it?(there are two answer)

采纳的回答

jonas
jonas 2018-8-12
If A is a vector with your answers. Remove non-negatives by
A(A>=0)=[]
  2 个评论
Najmeh Eskandari
Najmeh Eskandari 2018-8-13
no it is inverse cos and has two answers. i want to keep positive answer and think it is not a vector.
jonas
jonas 2018-8-13
编辑:jonas 2018-8-13
I don't understand. What function did you use? The fact that you want to keep only one value implies that you have two, hence my simple fix.
MATLAB's acos however only returns a single positive solution. If you want a negative solution, just multiply by -1, as cos(x)=cos(-x)
"For real elements of x in the interval [-1,1], acos(x) returns real values in the interval [0,pi]." - the doc

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by