Tue 11 Jul 2017 04:25:48 PM UTC, comment #9:
This does need to be tackled, but it is not going to be easy. Matlab's documentation refers to cellstr as
Octave has assumed, quite reasonably, that a character vector is a 1xN char array. But the code examples clearly show that Matlab doesn't require a vector---It only requires a char array object for each cell.
Also, Matlab has recently introduced string arrays which are yet another fundamental object type to join char arrays and cellstrs. Eventually Octave will probably support these so it makes sense that at the same time that is_string, string_value, and cellstr_value are overhauled to make them Matlab compatible, that we also address string arrays. In fact, we might want to reserve is_string to test for the new string array class and use another function name (maybe ischar?) to test if something is just a char array.
Some more slightly bad news. I did work up a cset that fixes the issue with strcmp, but by avoiding cellstr it is 10X slower.
|
Fri 07 Jul 2017 08:04:53 PM UTC, comment #1:
So to me the immediately interesting cases are
The 3-dimensional cases probably fail because
but elsewhere in Octave's baseline, code expects that if something is a cellstr, it can be converted into a vector of strings.
What does Matlab iscellstr return in this case?
|
Fri 07 Jul 2017 09:48:27 AM UTC, original submission:
strcmp seems to differ from Matlab when the input is not a row vector, see with the following code:
In Octave:
while in Matlab:
|