BUG DESCRIPTION:----------------asciimat() is a pure internal Matlab conversion function. There is no asciimat() function neitherin Matlab nor in Octave.Almost all its calls in Scilab are from functions of the M2SCI converter,mainly from convert2double() that is called by almost all sci_functions.The very few remaining calls outside [m2sci] are artificial and can be replaced by trivialascii() equivalent calls.This is why asciimat() should be moved into SCI/modules/m2sci/macros/kernel, and its page to SCI/modules/m2sci/help.A true distinct Scilab asciiMat() could be implemented for Scilab string objects of distinct lengthsand without horizontal concatenation, if it is required.asciimat() is aimed to comput an equivalence of the Matlab/Octave +/- operations between char strings-- not texts -- and numbers, as in>> ['abc';'def']+0ans = 97 98 99 100 101 102But to this respect, the present asciimat() implementation is bugged:1) The empty char '' is wrongly managed:--> asciimat(['abc';'';'def']) // yields a transposed result ans = 97. 98. 99. 100. 101. 102.while with Matlab as with Octave:>> ['abc';'';'def']+0ans = 97 98 99 100 101 1022) When converting an hypermatrix of ascii codes to strings, the dim#2 of the result is wrongly squeezed:--> t = cat(3,['abc' 'd';'e' 'fgh'],['ij' 'kl';'mno' 'p']) t = (:,:,1) "abc" "d" "e" "fgh"(:,:,2) "ij" "kl" "mno" "p" --> c = asciimat(t) // OK ans = (:,:,1) 97. 98. 99. 100. 101. 102. 103. 104.(:,:,2) 105. 106. 107. 108. 109. 110. 111. 112.--> asciimat(c) // KO ans = "abcd" "ijkl" "efgh" "mnop"// Expected: ans = (:,:,1) "abcd" "efgh"(:,:,2) "ijkl" "mnop"as with Matlab and Octave:>> t = cat(3,['abc' 'd';'e' 'fgh'],['ij' 'kl';'mno' 'p']);>> c = t+0c =ans(:,:,1) = 97 98 99 100 101 102 103 104ans(:,:,2) = 105 106 107 108 109 110 111 112>> char(c)ans =ans(:,:,1) =abcdefghans(:,:,2) =ijklmnopERROR LOG:----------None. Wrong resultsHOW TO REPRODUCE THE BUG:-------------------------// 1) The empty char '' is wrongly managed:r = asciimat(['abc';'';'def']) // yields a transposed resultand(r==[97 98 99 ; 100 101 102])// 2) When converting an hypermatrix of ascii codes to strings, the dim#2 of the result is wrongly squeezed:t = cat(3,['abc' 'd';'e' 'fgh'],['ij' 'kl';'mno' 'p']);c = asciimat(t)r = asciimat(c)and(size(r) == [2 1 2])OTHER INFORMATION:------------------See also the bug 16438 about supporting UTF-8 characters and input strings of distinct lengths.
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
The empty char '' is wrongly managed:
--> asciimat(['abc';'';'def']) // yields a transposed result
.../...
while with Matlab as with Octave:
['abc';'';'def']+0
ans =
97 98 99
100 101 102
Note that rows equal to the empty character string '' are removed by the concatenation, not by the conversion into numbers.
This is why this removal must not be done by asciimat().
In Matlab/Octave, there is no way to built a column of character strings including some '' rows.