为了账号安全,请及时绑定邮箱和手机立即绑定

程序如下:这里为什么rows能对col操作?

程序如下:这里为什么rows能对col操作?

牧羊人nacy 2022-10-19 19:15:40
 [values rows]=max([2 7 42;9 14 8;10 12 45])values =10 14 45rows =3 2 3>> [value col]=max(values)value =45col =3>> row=rows(col)row =3
查看完整描述

2 回答

?
不负相思意

TA贡献1777条经验 获得超10个赞

Matlab中rows()函数的作用:
返回引用或数组的行数。

语法使用:ROWS(array);
参数:Array 是需要得到其行数的数组、数组公式或对单。

元格区域的引用:
实例:
公式“=ROWS(A1:A9)”返回9,=ROWS({1,2,3; 4,5,6;1,2,3})返回3。

查看完整回答
反对 回复 2022-10-24
?
一只名叫tom的猫

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;


查看完整回答
反对 回复 2022-10-24
  • 2 回答
  • 0 关注
  • 166 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号