ndims
Number of dimensions of an array.
📝Syntax
n = ndims(M)
📥Input Arguments
Parameter Description
M a variable
📤Output Arguments
Parameter Description
n a integer value: Number of dimensions of M.
📄Description

n = ndims(M) return the number of dimension of the array M.

M is greater than or equal to 2.

💡Examples
ndims(ones(3, 0))
ndims(3)
ndims([1 2 3 4 5])
ndims(ones(3, 4, 5))
🔗See Also
sizelength
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub