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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -