| 
 | 
	
    
 
* Z. ^: y$ ?3 E* t/ S# W联用cellfun,arrayfun等函数$ z: \8 P- d% i9 E9 P; U 
c = cell(3,3); 
6 d' P" w& R8 j' ]c{1,1} = rand(1,2);" y5 M- {/ M1 g2 I. a 
c{2,1} = rand(1,4);( Y/ H) Q' H- e6 F( @ 
c{2,2} = rand(1,3); 
" }, p* V7 @0 D0 ~' U: Ec{3,2} = rand(1,5);' x( |8 \6 Y. ~7 O3 |" y8 ] 
c{3,3} = rand(1,6);8 q. u1 }/ ]) z4 Q' L  ]4 q2 N: ~! ^ 
idx = find(~cellfun(@isempty,c)); 
+ G8 J8 t' k0 u# O0 k( E8 H' D7 iresult = arrayfun(@(ii) c{idx(ii)}, [1:1:numel(idx)],'UniformOutput', false)! l3 ]0 Z) c' I+ ?7 J+ F 
复制代码 
6 X  L1 q+ H2 v6 \! J  j- d+ o6 `4 u0 V  [' a 
result  = 
) ]! y3 m) B, c1 M1 V9 a7 `- t  1×5 cell 数组 
" Z4 E! `; Z) n    {1×2 double}    {1×4 double}    {1×3 double}    {1×5 double}    {1×6 double} |   
 
 
 
 |