a={\'a\',\'aa\',\'aaa\',\'aaaa\'} length(a) 4 size(a) 1 4
How can I get the length of each element in the cell array with a single comm
arrayfun - Apply function to each element of array check documentation: http://www.mathworks.com/help/techdoc/ref/arrayfun.html
cellfun('length',a)
"apply length(x) to each element x in a".
length(x)
x
a
cellfun docs.