What condition to use for checking whether at least a single negative element in a array?
26 views (last 30 days)
Show older comments
Commented: Neil Sam on 10 Apr 2018
For example, what condition to use instead of '<' to execute the content inside if (to check if whether at least a single negative entry exists)?
if (A.*B < 0)
Roger Stafford on 10 Apr 2018
Edited: Roger Stafford on 10 Apr 2018
Use the 'any' logical function.
If you are dealing with an array, C, of more than one dimension, do this:
More Answers (0)
Find more on Biological and Health Sciences 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!