Thank you very much, linuxer, this is indeed one line :-)
Still, is there no built-in function in perl which returns the indices of an array based on a boolean query?
I am moving to perl from matlab (don't want to get into fights about which programming languages are the best (or whether matlab can be considered as one in the first place ;-)), but I think matlab has an edge here, since the equivalent matlab code would be:
a=a(find(b>1))
In reply to Re^2: Boolean array indexing
by johnmillerflorida
in thread Boolean array indexing
by johnmillerflorida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |