Wilang Documentation1.0.0+4

count#

Count the number of elements of a matrix, array or string.

Available in: math cells, REPL.

Syntax#

count(x)

Arguments and behavior#

For matrices, dimensions must match the operation. Singular matrices or incompatible shapes can fail. Cell indexing starts at 1. The example returns scalar (number).

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
a = [1, 2; 3, 4; 5, 6]
count("hello world")

Expected result: 11.

See also#

size

All functions · Math guides