dims - Data format of dlarray object - MATLAB (original) (raw)
Main Content
Data format of dlarray
object
Syntax
Description
The dims
function returns the data format of the input.
A data format is a string of characters, where each character describes the type of the corresponding data dimension.
The characters are:
"S"
— Spatial"C"
— Channel"B"
— Batch"T"
— Time"U"
— Unspecified
For example, consider an array containing a batch of sequences where the first, second, and third dimensions correspond to channels, observations, and time steps, respectively. You can specify that this array has the format "CBT"
(channel, batch, time).
[d](#mw%5Ff3954738-3636-44bc-b0d5-9f835ab1ed64) = dims([X](#mw%5F47b389cd-9e78-4ccb-a98e-91a50f7d6953%5Fsep%5Fmw%5F6f734774-5538-44ff-ad05-7e744f97893a))
returns the data format of X
as a character array. The data format provides the dimension labels for each dimension in X
.
Examples
Obtain Dimension Labels
Obtain the dimension labels of a formatted dlarray
.
dlX = dlarray(randn(3,4),'TS'); d = dims(dlX)
Obtain the labels of an unformatted dlarray
.
y = stripdims(dlX); d = dims(y)
Input Arguments
X
— Input data
dlarray
object
Input data, specified as a formatted or unformatted dlarray object.
Output Arguments
d
— Dimension labels
character vector
Dimension labels, returned as a character vector. If the inputX 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