powered by
Provides number of array dimensions.
ndims(A)
Returns the number of dimensions in the array A.
A
object of which to determine the number of dimensions
P. Roebuck proebuck1701@gmail.com
Simply invokes length(size(A)).
length(size(A))
size
ndims(2:9) # 2 ndims(magic(4)) # 2 ndims(array(1:8, c(2,2,2))) # 3
Run the code above in your browser using DataLab