finddim
Find dimensions with specified label
Syntax
Description
Examples
Obtain Dimension with Specified Labels
Create a formatted dlarray
with some repeated dimension labels. Specify the dimension labels as 'TSSU'
. The dlarray
call reorders the labels, because it enforces the order 'SCBTU'
. For more information about dimension labels, see Usage.
dlX = dlarray(randn(5,4,3,2),'TSSU');
Obtain the dimensions with the label 'T'
.
dimT = finddim(dlX,'T')
dimT = 3
Obtain the dimensions with the label 'S'
.
dimS = finddim(dlX,'S')
dimS = 1×2
1 2
Obtain the dimensions with the label 'B'
.
dimB = finddim(dlX,'B')
dimB = 1x0 empty double row vector
Obtain the size of the dlX
dimensions labeled 'S'
.
SSize = size(dlX,finddim(dlX,'S'))
SSize = 1×2
4 3
Input Arguments
X
— Input dlarray
dlarray
object
Input dlarray
, specified as a dlarray
object.
Example: X = dlarray(randn(3,4),'ST')
label
— Single dimension label
'S'
| 'C'
| 'B'
| 'T'
| 'U'
Single dimension label, specified as one of the following dlarray
dimension labels:
S
— SpatialC
— ChannelB
— Batch observationsT
— Time or sequenceU
— Unspecified
Example: "C"
Data Types: char
| string
Output Arguments
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
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 label argument must be a compile-time constant.
Version History
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)