Wed 21 Apr 2010 04:57:12 PM UTC, comment #1:
This is confirmed on a recent hg tip (fdf28dae0f37, Apr 20th:2010)
Assignments using a null selection have trouble when the rhs side is not of type double.
For example,
-----------------------------------
octave:1> x([]) = single(1)
x = [](0x0)
octave:2> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x13 111 cell
x 0x0 0 double
Total is 13 elements using 111 bytes
-----------------------------------
This correctly sets x to [] but fails to set the class correctly to single.
----------------------------------
octave:7> clear x
octave:8> x([]) = logical(1)
x = 0
octave:9> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x13 111 cell
x 1x1 1 logical
Total is 14 elements using 112 bytes
----------------------------------
This correctly sets the class to logical but does not initialize the value of x to the null array.
----------------------------------
octave:10> clear x
octave:11> x([]) = char("A")
x =
octave:12> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x13 111 cell
x 0x0 0 char
Total is 13 elements using 111 bytes
-----------------------------------
The operator seems to work correctly for the char datatype.
It appears 'single' and 'logical' need some work.
|