How to find which postions in a vector has negative values and output them?
2 views (last 30 days)
Show older comments
sairohith mudduluru
on 17 Feb 2018
Commented: Stephen23
on 19 Feb 2018
i have a vector and need to find the postions which has negative values
0 Comments
Accepted Answer
More Answers (1)
Stephen23
on 17 Feb 2018
find is not required, logical indexing is simpler and more efficient:
B = A(A<0)
2 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!