2013-02-18 2 views

回答

1

isrow(V)iscolumn(V)功能可从Matlab 2011a

1

您可以使用下面的代码isrow()

function Y = isrow(X) 
% 
% ISROW True for row vectors. 
% 
% Y = ISROW(X) returns logical 1 if X is a row vector, 0 otherwise. 
% ISROW returns 1 for scalars also. 
% 
% See also: ISCOL. 
% 

if ndims(X)==2 & size(X,1)==1 & size(X,2)>=1 
    Y = logical(1); 
else 
    Y = logical(0); 
end 

Source via MATLAB Central

相关问题