MATLAB: Number of values above threshold in cell array.

cell arrayssumthreshold value

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 = 0
while X < 4;
X = X+1;
A = sum(A{X} < 0, 1)
but I only get the result of the last loop.

Best Answer

I suggest looking at the cellfun command, which applies a given function to each cell in a cell array.
Specifically, I think this does what you want:
Acount = cellfun(@(x)sum(x>0),A)