Sun 28 Feb 2016 06:39:25 PM UTC, comment #1:
I have attached a file that fixes this issue. It has two csets, fixing two different bug related bugs.
I found that this was not an issue for the special cases of sum, max, and min because they use a special code path. I still added test cases for them to avoid regressions in the future.
I don't really like the fix. I couldn't find an elegant way to do it, and had to resort to a "n != 0". If anyone has a better plan that would be great.
The second cset fixes a related issue which is being able to automatically find the output size when list of subscript is empty.
This whole thing introduce a Matlab incompatibility though (I guess it could be considered a Matlab bug). It was not on purpose but came out as a side effect of fixing the support for empty SUBS.
When FUNC returns a cell element, and SUBS is empty, we are now returning a cell array (previously we would error). This makes sense to me, FUNC is meant to create a cell array. Matlab seems to always return an array of doubles. However, we still only do this for the general case of '@(x) {x}'.
(file #36499)
|
Sat 27 Feb 2016 06:23:12 PM UTC, original submission:
accumarray() does not handle an empty list of subscripts. Example:
I would expect to get back an empty matrix.
|