MATLAB Answers


keep just positive or just negetive answer of acos?

Najmeh Eskandari さんによって質問されました 2018 年 8 月 12 日
最新アクティビティ jonas
さんによって 編集されました 2018 年 8 月 13 日
I have arccos and I want to keep just negative answer of it? how can I do it?(there are two answer)

  0 件のコメント

サインイン to comment.


1 件の回答

回答者: jonas
2018 年 8 月 12 日

If A is a vector with your answers. Remove non-negatives by

  2 件のコメント

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.
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

サインイン to comment.

Translated by