Effacer les filtres
Effacer les filtres

keep just positive or just negetive answer of acos?

11 vues (au cours des 30 derniers jours)
Najmeh Eskandari
Najmeh Eskandari le 12 Août 2018
Modifié(e) : jonas le 13 Août 2018
I have arccos and I want to keep just negative answer of it? how can I do it?(there are two answer)

Réponse acceptée

jonas
jonas le 12 Août 2018
If A is a vector with your answers. Remove non-negatives by
A(A>=0)=[]
  2 commentaires
Najmeh Eskandari
Najmeh Eskandari le 13 Août 2018
no it is inverse cos and has two answers. i want to keep positive answer and think it is not a vector.
jonas
jonas le 13 Août 2018
Modifié(e) : jonas le 13 Août 2018
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by