mtlb_a(), mtlb_s(), %a2sci() and %s2sci are not up-to-date nor complete, nor their help page
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
After the []+A => A change in Scilab 6,
* the code of mtlb_a() and mtlb_s() can be simplified. Indeed, the processing
if a==[] | b==[] then
y=[];
is now the default one.
* the pages of both functions must be updated:
https://help.scilab.org/docs/6.0.1/en_US/mtlb_a.html
https://help.scilab.org/docs/6.0.1/en_US/mtlb_s.html
1) The statements
With empty matrix: In Scilab, if one of the operands is an empty matrix the result of the addition
is the other operand. In Matlab if one of the operand is an empty matrix the result of the addition
should be an error or an empty matrix.
AND
If both A and B are not empty matrices mtlb_a(A,B) may be replaced by A+B, else mtlb_a(A,B) may be replaced by [].
are no longer true and must be removed.
2) The reference to mtlb_mode() must be replaced with oldEmptyBehaviour()
and the statement
If mtlb_mode()==%T, then mtlb_s(A,B) may be replaced by A-B in any case
where A and B are not character string matrices.
must be removed.
* the code of both mtlb_a() and mtlb_s() must be extended in order to implement
the Octave behavior for text operands: The pages document it, but the code does not handle it!
In Octave:
>> "ab" + "cd"
ans =
196 198
>> "ab" - "cd"
ans =
-2 -2
In Scilab:
--> mtlb_a("ab","cd")
ans =
abcd
--> mtlb_s("ab", "cd")
in builtin mtlb_s ( SCI\modules\compatibility_functions\macros\mtlb_s.sci line 12 )
Undefined operation for the given operands.
check or define function %c_s_c for overloading.
ERROR LOG:
----------
none. Misleading information, and incomplete code.
HOW TO REPRODUCE THE BUG:
-------------------------
https://help.scilab.org/docs/6.0.1/en_US/mtlb_a.html
https://help.scilab.org/docs/6.0.1/en_US/mtlb_s.html
mtlb_a("ab","cd")
mtlb_s("ab", "cd")