So I have this cell array that is A.
Each cell in the array is composed of 26*1 double that are each filled with numerical elements and there are four of these in array {A}.
It looks like:
A = {26*1 double} {26*1 double} {26*1 double} {26*1 double}
My question is how do I list and save the number of elements that are above a threshold value of 0 in each cell of array A?
For example in the first row there are 5 elements that are above the value 0. In the second row there are 2 elements that are above 0. In the third row there are 4 elements that are above 0. In the fourth row there are 1 elements that are above 0.
So the result should look something like:
A = [5 2 4 1]
I have tried looping with
X = 0while X < 4; X = X+1; A = sum(A{X} < 0, 1)
but I only get the result of the last loop.
Best Answer