I have a 3D cell A with dimensions 3x5x2. An example of elements along row 2, all columns and z dimension = 1 is:
x = [ ] [ ] 5.1 [ ] 7.9
I would like to add up the non zero entries and get the number of non zero entries in this resulting array. I tried using:
But got the following error:
"Error using sum
Invalid data type. First argument must be numeric or logical."
Could anyone please help me with this and would kindly let me know the procedure to solve such problems.