Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

length

Outputs the length of the given object.

length(M)

Returns a scalar that is basically the number of rows times the number of columns.

Argument M

Matrix

Returns 1. entry

Scalar

Example

length([1,2,3,4,5;6,7,8,9,10])

Results in a scalar value of 10, since we have 5 columns and 2 rows.

length(x)

Returns the length of a scalar, which is just 1.

Argument x

Scalar

Returns 1. entry

Scalar

length(str)

Returns the length of the string, which is the number of characters.

Argument str

String

Returns 1. entry

Scalar

Example

length("hello")

This is evaluated to be 5, which is the number of characters in the given string.

Clone this wiki locally