Chapter 10: Matrices
156
Note:
dim(
matrix
)
"
L
n
:L
n
(1)
returns the number of rows.
dim(
matrix
)
"
L
n
:L
n
(2)
returns the number of
columns.
Creating a Matrix with dim(
Use
dim(
with
¿
to create a new
matrixname
of dimensions
rows
×
columns
with 0 as each element.
{
rows
,
columns
}
"
dim(
matrixname
)
Redimensioning a Matrix with dim(
Use
dim(
with
¿
to redimension an existing
matrixname
to dimensions
rows
×
columns
. The
elements in the old
matrixname
that are within the new dimensions are not changed. Additional
created elements are zeros. Matrix elements that are outside the new dimensions are deleted.
{
rows
,
columns
}
"
dim(
matrixname
)
Fill(
Fill(
stores
value
to every element in
matrixname
.
Fill(
value
,
matrixname
)
identity(
identity(
returns the identity matrix of
dimension
rows ×
dimension
columns.
identity(
dimension
)