Main Content

dims

Dimension labels of dlarray

Description

example

d = dims(X) returns the data format of X as a character array. The data format provides the dimension labels for each dimension in X.

Examples

collapse all

Obtain the dimension labels of a formatted dlarray.

dlX = dlarray(randn(3,4),'TS');
d = dims(dlX)
d = 
'ST'

Obtain the labels of an unformatted dlarray.

y = stripdims(dlX);
d = dims(y)
d =

  0x0 empty char array

Input Arguments

collapse all

Input data, specified as a formatted or unformatted dlarray object.

Output Arguments

collapse all

Dimension labels, returned as a character vector. If the input X is unformatted, d is empty.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2019b