ndims | R Documentation |
Obtain the number of dimensions of an array [arrays, matrices, and vectors] in a manner compatible with GNU Octave/MATLAB.
ndims(x)
x |
An array (array, matrix, vector) |
"Return the number of dimensions of a. For any array, the result will always be greater than or equal to 2. Trailing singleton dimensions are not counted." Source: Eaton page 46.
Irucka Embry, Samit Basu (FreeMat)
Samit Basu (2002-2006). FreeMat v4.0, https://freemat.sourceforge.net/help/inspection_ndims.html.
John W. Eaton, David Bateman, Søren Hauberg, and Rik Wehbring (November 2022). GNU Octave: A high-level interactive language for numerical computations: Edition 7 for Octave version 7.3.0. https://docs.octave.org/octave.pdf. Page 46.
size
library(iemisc)
# Examples from GNU Octave ndims
b <- matlab::ones(c(4, 1, 2, 1))
ndims(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.