Algosim documentation: height

height

Returns the height of a matrix or a pixmap.

Syntax

Description

For a two-dimensional container, such as a matrix or a pixmap, height(X) returns the height of X.

A vector is treated like a two-dimensional container in the form of a column matrix.

For all other objects, height(X) returns 1.

Examples

A ≔ ❨❨6, 3, 2, 0, 4, 5❩, ❨7, 0, 2, 1, 4, 2❩, ❨6, 2, 3, 1, 4, 2❩, ❨8, 0, 2, 3, 3, 5❩, ❨4, 2, 6, 3, 2, 0❩❩
⎛6  3  2  0  4  5⎞
⎜7  0  2  1  4  2⎟
⎜6  2  3  1  4  2⎟
⎜8  0  2  3  3  5⎟
⎝4  2  6  3  2  0⎠
height(A)
5
bm ≔ ComputePixmap(200, 200, x, y, rgb(x/199, y/199, 0.5))
A pixmap of size 200×200.
height(bm)
200
height(π)
1

See also