📄 mf_rows.hlp
字号:
{smcl}
{* 15mar2004}{...}
{cmd:help mata rows()}
{hline}
{* index rows()}{...}
{* index cols()}{...}
{* index length()}{...}
{* index length}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] rows() -- Number of rows and number of columns}
{title:Syntax}
{p 8 8 2}
{it:real scalar}
{cmd:rows(}{it:transmorphic matrix P}{cmd:)}
{p 8 8 2}
{it:real scalar}
{cmd:cols(}{it:transmorphic matrix P}{cmd:)}
{p 8 8 2}
{it:real scalar}
{cmd:length(}{it:transmorphic matrix P}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:rows(}{it:P}{cmd:)} returns the number of rows of {it:P}.
{p 4 4 2}
{cmd:cols(}{it:P}{cmd:)} returns the number of columns of {it:P}.
{p 4 4 2}
{cmd:length(}{it:P}{cmd:)} returns
{cmd:rows(}{it:P}{cmd:)}*{cmd:cols(}{it:P}{cmd:)}.
{title:Remarks}
{p 4 4 2}
{cmd:length(}{it:P}{cmd:)}
is typically used with vectors, as in
{cmd:for (i=1; i<=length(x); i++) {c -(}}
... {cmd:x[i]} ...
{cmd:{c )-}}
{title:Conformability}
{cmd:rows(}{it:P}{cmd:)}, {cmd:cols(}{it:P}{cmd:)}, {cmd:length(}{it:P}{cmd:)}:
{it:P}: {it:r} {it:x} {it:c}
{it:result}: 1 {it:x} 1
{title:Diagnostics}
{p 4 4 2}
{cmd:rows(}{it:P}{cmd:)}, {cmd:cols(}{it:P}{cmd:)}, and
{cmd:length(}{it:P}{cmd:)} return a result that is
greater than or equal to zero.
{title:Source code}
{p 4 4 2}
Functions are built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] rows()}
{p 4 13 2}
Online: help for
{bf:{help m4_utility:[M-4] utility}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -