UNPKG

856 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function size
4
5Calculate the size of a matrix or scalar.
6
7
8## Syntax
9
10```js
11math.size(x)
12```
13
14### Parameters
15
16Parameter | Type | Description
17--------- | ---- | -----------
18`x` | boolean &#124; number &#124; Complex &#124; Unit &#124; string &#124; Array &#124; Matrix | A matrix
19
20### Returns
21
22Type | Description
23---- | -----------
24Array &#124; Matrix | A vector with size of `x`.
25
26
27## Examples
28
29```js
30math.size(2.3) // returns []
31math.size('hello world') // returns [11]
32
33const A = [[1, 2, 3], [4, 5, 6]]
34math.size(A) // returns [2, 3]
35math.size(math.range(1,6)) // returns [5]
36```
37
38
39## See also
40
41[count](count.md),
42[resize](resize.md),
43[squeeze](squeeze.md),
44[subset](subset.md)