matlab - determine average length of cells in a cell array -
this question has answer here:
hi have cell array in matlab, cells of differing lengths. how determine average length of cells.
i have tried:
mean(length(mycell{:});
however many inputs mean function.
thanks.
use cellfun
mean( cellfun( @length, mycell ) )
btw, of builtin functions might better write
mean( cellfun( 'length', mycell ) )
Comments
Post a Comment