Create a dlarray with some repeated labels. Specify the labels as 'TSSU'. The dlarray call reorders the labels, because it enforces the order 'SCBTU'. See Usage.
dlX = dlarray(randn(5,4,3,2),'TSSU');
Obtain the dimensions with the label 'T'.
dimU = finddim(dlX,'T')
dimU = 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'.