www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/NumberofElementsinCellArrayofStringsExample.m

    %% Number of Elements in Cell Array  

%% 
% Create a cell array of character vectors. 
A = {'dog','cat','fish','horse'};  

%% 
% |numel| counts 4 elements in the array. 
n = numel(A)