finddim
Description
Examples
Find Dimensions of dlarray
Object
Create a formatted dlarray
with format "SSCBT"
(spatial, spatial, channel, batch, time).
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"
.
dim = finddim(X,"S")
dim = 1×2
1 2
Find Dimensions of Network Data Layout Object
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");
Find the dimensions with the label "S"
.
dim = finddim(layout,"S")
dim = 1×2
1 2
Input Arguments
X
— Input data
dlarray
object
Input data, specified as a formatted or unformatted dlarray
object.
layout
— Network data layout
networkDataLayout
object
Network data layout, specified as a networkDataLayout
object.
label
— Dimension label
"S"
|
"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
Output Arguments
dim
— Dimension
vector of positive integers
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.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
The input data must be a
dlarray
object.The label argument must be a compile-time constant.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
Usage notes and limitations:
The input data must be a
dlarray
object.The label argument must be a compile-time constant.
Version History
Introduced in R2019b
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)