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

    %% Find Dimensions of Vector  

%% 
% Create a row vector. 
A = 1:5;  

%% 
% Find the number of dimensions in the vector. 
ndims(A) 

%%
% The result is |2| because the vector has a size of 1-by-5.