2 回答

TA贡献1777条经验 获得超10个赞
Matlab中rows()函数的作用:
返回引用或数组的行数。
语法使用:ROWS(array);
参数:Array 是需要得到其行数的数组、数组公式或对单。
元格区域的引用:
实例:
公式“=ROWS(A1:A9)”返回9,=ROWS({1,2,3; 4,5,6;1,2,3})返回3。

TA贡献1906条经验 获得超3个赞
这里的rows是一个方法,你可以调用,不是咱们平常的行的意思!你可以看看help rows:
function nrows = rows(cursor)
%ROWS Get number of rows in fetched data set.
% NROWS = ROWS(CURSOR) returns the number of rows
% retrieved by a database fetch operation. CURSOR is
% a cursor structure in which all elements have values.
%
% Example:
%
% nrows = rows(cursor)
%
% upon execution of the function nrows contains the
% the number of rows returned by the fetch.
%
% cursor=exec(conn,'select * from employees');
% cursor=fetch(cursor);
% nrows=rows(cursor)
%
% nrows = 9
%
% indicating there are 9 rows returned by FETCH.
%
% See also FETCH.
% Author: E.F. McGoldrick, 09-02-97
% Copyright 1984-2003 The MathWorks, Inc.
% $Revision: 1.14.4.2 $ $Date: 2004/04/06 01:05:11 $%
if isempty(cursor.Cursor)
nrows = -1;
return;
end
if ~isempty(cursor.Fetch)
nrows = double(rowsFetched(cursor.Fetch));
else
nrows = -1;
end;
- 2 回答
- 0 关注
- 166 浏览
添加回答
举报