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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -