📄 mf_i.hlp
字号:
{smcl}
{* 21mar2005}{...}
{cmd:help mata I()}
{hline}
{* index identity matrix}{...}
{* index I()}{...}
{* index design matrix}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] I() -- Identity matrix}
{title:Syntax}
{p 8 12 2}
{it:real matrix}
{cmd:I(}{it:real scalar n}{cmd:)}
{p 8 12 2}
{it:real matrix}
{cmd:I(}{it:real scalar m}{cmd:,} {it:real scalar n}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:I(}{it:n}{cmd:)}
returns the {it:n x n} identity matrix.
{p 4 4 2}
{cmd:I(}{it:m}{cmd:,} {it:n}{cmd:)}
returns an {it:m x n} matrix with 1s down its principal diagonal and 0s
elsewhere.
{title:Remarks}
{p 4 4 2}
Note that {cmd:I()} must be typed in uppercase.
{title:Conformability}
{cmd:I(}{it:n}{cmd:)}:
{it:n}: 1 {it:x} {it:1}
{it:result}: {it:n x n}
{cmd:I(}{it:m}{cmd:,} {it:n}{cmd:)}:
{it:m}: 1 {it:x} {it:1}
{it:n}: 1 {it:x} {it:1}
{it:result}: {it:m x n}
{title:Diagnostics}
{p 4 4 2}
{cmd:I(}{it:n}{cmd:)} aborts with error if {it:n} is less than 0 or is
missing.
{it:n} is interpreted as {cmd:trunc(}{it:n}{cmd:)}.
{p 4 4 2}
{cmd:I(}{it:m}{cmd:,} {it:n}{cmd:)}
aborts with error if {it:m} or {it:n} are less than 0
of if they are missing.
{it:m} and {it:n} are interpreted as
{cmd:trunc(}{it:m}{cmd:)} and
{cmd:trunc(}{it:n}{cmd:)}.
{title:Source code}
{p 4 4 2}
{cmd:I()} is built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] I()}
{p 4 13 2}
Online: help for
{bf:{help m4_matrix:[M-4] matrix}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -