Wed 21 May 2014 03:50:43 PM UTC, comment #1:
The online documentation is for the latest release of Octave, 3.8, which you can download here for Windows:
http://mxeoctave.osuv.de/
On 3.8, the example works for me.
If you need to use 3.6.4, then use "doc strsplit" from within Octave to read the documentation for 3.6.4.
|
Wed 21 May 2014 03:45:03 PM UTC, original submission:
I was trying to split a string into individual strings. I followed the documentation and it did not work. So I tried copying and pasting the example and that did not work either. Then I made a change and it worked. see the examples below.
Example from documentation: https://www.gnu.org/software/octave/doc/interpreter/Manipulating-Strings.html
octave:54> strsplit ("a,,b, c", {",", " "}, false)
error: strsplit: S and SEP must be string values
error: called from:
error: C:OctaveOctave3.6.4_gcc4.6.2shareoctave3.6.4mstringsstrsplit.m at line 59, column 5
I changed the braces to brackets and it worked:
octave:54> strsplit ("a,,b, c", [",", " "], false)
ans =
{
[1,1] = a
[1,2] =
[1,3] = b
[1,4] =
[1,5] = c
}
Not sure if this is an Octave problem or somehow just a problem with my system. I am using a windows seven machine and gcc4.6.2
|