I have a nested cell that represents a tree structure:
CellArray={1,1,1,{1,1,1,{1,1,{1,{1 1 1 1 1 1 1 1}, 1,1},1,1},1,1,1},1,1,1,{1,1,1,1}};
I want to find out the number of nodes in Matlab. I put a simple picture below, which can help you understand what I'm looking for more accurately:

Thanks.
source
share