k-Wave Toolbox
k-Wave Toolbox Previous   Next

numDim

Return the number of matrix dimensions

Syntax

dim = numDim(x)

Description

numDim returns the number of dimensions of a matrix x. Unlike the inbuilt ndims, numDim returns 1 for 1D vectors, 2 for 2D arrays, etc.

Inputs

x

matrix with unknown number of dimensions

Outputs

dim

number of dimensions

See Also

ndims


© 2009-2014 Bradley Treeby and Ben Cox.