If i do
mat = rand(8,8)
sum(mat, 1)
the return type is a single row matrix, while it sum(mat, 2)gives a single column matrix. This surprises me, since the size of a singleton is usually reduced by 0.5, so I expect that the return type of both operations will be a Vector. Why is the size of the singleton not discarded here?
I could expect that this would be to preserve orientation (for example, sum(mat, 1)this is a row vector), but the behavior is the same at 0.6, which has explicit 1-d RowVectors, so this does not seem to explain.
Thank!
source
share