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
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)