\(\text{SizeOf}\)

You can use the \(\text{SizeOf}\) function to determine the number elements in a set, tuple or matrix.

You can use the \sizeof backslash command to insert this function.

The following variants of this function are available:

  • \(\text{integer } \text{SizeOf} \left ( \text{<iterable>} \right )\)

The \(\text{<iterable>}\) is the iterable type to determine the size of.

The \(\text{SizeOf}\) function returns the number of elements.

Note

Note that, while both the \(\text{SizeOf}\) function and \(\text{Count}\) function can both be used to determine the size of an iterable value; however, the \(\text{SizeOf}\) function will be faster.

Below are several examples using the \(SizeOf\) function.

\[\begin{split}A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\end{split}\]
\[a = \text{SizeOf } A \;\;\;\; \text{a = 6}\]
\[B = \left \lbrace 1, 3, \ldots, 15 \right \rbrace\]
\[b = \text{SizeOf } B \;\;\;\; \text{a = 8}\]