ndims: Number of dimensions in an Array (GNU Octave/MATLAB...

ndimsR Documentation

Number of dimensions in an Array (GNU Octave/MATLAB compatible)

Description

Obtain the number of dimensions of an array [arrays, matrices, and vectors] in a manner compatible with GNU Octave/MATLAB.

Usage

ndims(x)

Arguments

x

An array (array, matrix, vector)

Value

"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.

Author(s)

Irucka Embry, Samit Basu (FreeMat)

References

  1. Samit Basu (2002-2006). FreeMat v4.0, https://freemat.sourceforge.net/help/inspection_ndims.html.

  2. 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.

See Also

size

Examples


library(iemisc)

# Examples from GNU Octave ndims

b <- matlab::ones(c(4, 1, 2, 1))

ndims(b)






iemisc documentation built on Sept. 25, 2023, 5:09 p.m.