-----Original Message-----
From: Sven Schreiber <svetosch(a)gmx.net>
Sent: Sunday, July 7, 2019 5:36 PM
> Actually, you got me thinking about the possibility of having a
second
> argiment to I() (aka F_IMAT); in many cases, you want to construct a
> matrix that is an identity matrix "plus some zeros"; without loss of
> backward compatibility, we may introduce an optional 2nd argument to
> I() such that I(r,c) returns
>
> * I(r) ~ zeros(r, c-r) if c > r,
> * I(c) | zeros(r-c, c) if r < c
> Besides, I believe this is what Matlab does, so this would also
be
> nice to have when porting scripts from the Octave/Matlab galaxy.
Yes it seems they do that. Of course, if you want to appeal to those people,
you could also make "eye" an alias for "I", but perhaps that would
rather be
something for Peter's matlab_utilities package.
As promised, version 0.3 of matlab_utilites now includes eye(n,m) with this behavior (and
m = 0 the default case). If the user's version is at least 2019d, it's just a
wrapper for I(n,m); otherwise it builds the matrices explicitly. I've just uploaded
the new version to the package server; if you let me know when it's been accepted I
can send a message to the users' list if you like.
Cheers,
PS