Using OR between elements in vector or antithesis of any(x)
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Is there a way to use an or command such as | between elements in a vector?
Alternatively:
Rather than use any(x) is there an antithetical command that returns true if any element of the vectorx is zero?
1 Commento
Stephen23
il 2 Mar 2021
"is there an antithetical command that returns true if any element of the vectorx is zero?"
~all(x)
will be simpler and more efficient than anything else.
Risposte (1)
Star Strider
il 1 Mar 2021
Not certain what you wnat.
Try these (the any call is there for comparison only):
x = randi([-5 5], 1, 10);
TF1 = any(x == 0);
TF2 = find(x==0)>0;
There may be other options as well.
2 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!