我有一个脚本,它在调用时使用 isrow和iscolumn函数,它会生成以下错误:
>> isrow( [1,2,3] )
??? Undefined function or method 'isrow' for input arguments of type 'double'.
我可以使用内置这些功能的最低版本的 Matlab 是什么?
isrow(V)
和iscolumn(V)
函数可从Matlab 2011a获得。
您可以使用以下代码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