2 回答

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超10個(gè)贊
Matlab中rows()函數(shù)的作用:
返回引用或數(shù)組的行數(shù)。
語法使用:ROWS(array);
參數(shù):Array 是需要得到其行數(shù)的數(shù)組、數(shù)組公式或?qū)巍?br/>
元格區(qū)域的引用:
實(shí)例:
公式“=ROWS(A1:A9)”返回9,=ROWS({1,2,3; 4,5,6;1,2,3})返回3。

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超3個(gè)贊
這里的rows是一個(gè)方法,你可以調(diào)用,不是咱們平常的行的意思!你可以看看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 關(guān)注
- 160 瀏覽
添加回答
舉報(bào)