string() output is broken for structs, lists or cells
Called with structs, lists or cells, string()
displays something and yields an empty string :
--> string(struct("x",1))
x = 1
ans =
""
--> string(list(1))
(1) = 1
ans =
""
--> string({1})
ans =
" [1x1 constant]
"
One would expect a matrix of strings (not an empty matrix), the same that is displayed when disp()
is called with the same arguments :
--> struct("x",1)
ans =
x = 1
--> disp(struct("x",1))
x = 1
--> disp(list(1))
(1) = 1
--> disp({1})
[1x1 constant]