LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_tensorsize.m
1function sz = moment_tensorsize(A)
2% sz = moment_tensorsize(A)
3%
4% Size of a joint moment array with the trailing singleton dimensions removed.
5%
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.
11%
12% Input:
13% A: joint moment array
14%
15% Output:
16% sz: row vector of the extents, with the trailing singleton dimensions
17% removed
18%
19% Reference:
20% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
21% distributions. PMCCS, 2003.
22
23sz = size(A);
24while numel(sz) > 1 && sz(end) == 1
25 sz(end) = [];
26end
27end