On Fri, Jun 28, 2024 at 10:19 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Hi, in the context of a problem in the SVAR addon I've stumbled over
what might be a bug in msplitby:
Consider this:
<hansl>
matrix M = {1,2}
matrices MM = msplitby(M, {2}) # gives invalid argument error
print MM
</hansl>
It seems to me the second argument is indeed erroneous here.
The doc says that if the second arg is a vector, it "must be of length
equal to the relevant (row or column) dimension of X, and should
contain integer values with a minimum of 1 and a maximum equal to the
number of matrices in the desired array." The relevant dimension is by
default the rows of M, and rows(M) is 1, which equals the length of
{2}, so the first part of the condition is satisfied. But the second
part is not satisfied, since the minimum in {2} is not 1.
This seems to be a wrongly specified corner case. Given that M has a
single row, the only vector second argument that could work here is
{1}.
Allin