Help CenterHelp Center
dlarray
Find dimensions with specified label
Since R2019b
dim = finddim(X,label)
dim = finddim(layout,label)
example
dim = finddim(X,label) returns the dimensions in the dlarray object X that have the specified dimension label.
dim
X
label
dim = finddim(layout,label) returns the dimensions in the networkDataLayout object layout that have the specified dimension label.
layout
networkDataLayout
collapse all
Create a formatted dlarray with format "SSCBT" (spatial, spatial, channel, batch, time).
"SSCBT"
X = dlarray(randn(6,5,4,3,2),"SSCBT");
View the dimension labels of X.
dims(X)
ans = 'SSCBT'
Find the dimensions with the label "S".
"S"
dim = finddim(X,"S")
dim = 1×2 1 2
Create a formatted network data layout object representing 2-D image sequences. Specify the format "SSCBT" (spatial, spatial, channel, batch, time).
layout = networkDataLayout([227 227 3 NaN 100],"SSCBT");
dim = finddim(layout,"S")
Input data, specified as a formatted or unformatted dlarray object.
Network data layout, specified as a networkDataLayout object.
"C"
"B"
"T"
"U"
Dimension label, specified as one of the following dlarray dimension labels:
"S" — Spatial
"C" — Channel
"B" — Batch
"T" — Time
"U" — Unspecified
Dimension, returned as a vector of positive integers.
If the input is unformatted or has no dimension labels that match label, then dim is empty.
Usage notes and limitations:
The input data must be a dlarray object.
The label argument must be a compile-time constant.
Introduced in R2019b
dims | stripdims | dlarray | networkDataLayout
dims
stripdims
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office