sysdiag(): extend it to strings, make it actually overloadable, and rename it blockdiag()
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
sysdiag(): extend it to strings, make it overloadable, and rename it blockdiag()
Indeed, sysdiag()'s name is too specialized wrt the general "shaping" service it provides.
Moving it to the Elementary Functions > Matrix generation section (with diag) is proposed as bug 16164.
Cloning it as blockdiag() and obsoleting sysdiag() should be proposed for Scilab 6.1.0,
and removing it for Scilab 6.2.
In addition, wrt its reshaping role, there is no reason to prevent doing the same for string matrices, padding empty positions with "".
About this, the help page provides a wrong information: "sysdiag() cannot be used to arrange matrices made of character strings, but you can overload it (see: overloading).". This is wrong, since sysdiag() is a macro, and there is no explicit hook in it to overload it.
Finally, its help page should be fixed:
* A remark tells that max 17 inputs are allowed, while no such limitation is implemented.
* The note about sparse() looks wrong:
"Beside this function, you can also use sparse() primitive to build a block diagonal sparse matrix."
* The remark about its overloading is wrong.
HOW TO REPRODUCE THE BUG:
-------------------------
t = ["ab" "c"];
sysdiag(t, t)
function r = %c_sysdiag(varargin)
disp("%c_sysdiag")
endfunction
sysdiag(t,t)