1function sz = moment_tensorsize(A)
2% sz = moment_tensorsize(A)
4% Size of a joint moment array with the trailing singleton dimensions removed.
6% MATLAB cannot represent a trailing singleton dimension, so a
column vector of
7% n+1 elements and an (n+1)x1 joint moment array of a degenerate second class
8% are the same
object. The convention taken throughout the joint conversions
is
9% the first one: trailing singletons are dropped, so that a
column vector
is
10% treated as the d = 1 case.
13% A: joint moment array
16% sz: row vector of the extents, with the trailing singleton dimensions
20% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
21% distributions. PMCCS, 2003.
24while numel(sz) > 1 && sz(end) == 1