I understand this is a built-in function and that "legacy constraints" might be the answer, but still I'm really wondering why the inputs `subs` and `vals` need to be of the same size in `accumarray`.
IMO, a sufficient input check on subs (forgetting about input cells..) would be something like
subs = floor(subs);
assert( all(subs>0) && all(subs <= numel(vals)), 'Index out ouf bounds.' );
I really don't understand this constraint, can someone explain the logic behind this?