MATLAB: Counting elements of a matrix/array

no loops

I have a 1000×1000 array of uniformly distributed random numbers between -1 to 1. I need to come up with a way to count how many negative numbers are generated are in the array without using loops. I was able to do it with loops, but I am struggling with trying to figure out how to do it without loops. any answer is very appreciated 🙂

Best Answer

doc numel
Related Question