Mon 31 Oct 2011 08:52:43 PM UTC, original submission:
I've seen various versions of functions similarly named to strsplit, so I have some idea of how it should work... Presumably the first argument is a string, but the documentation isn't helpful and describes the parameter as "P" but fails to describe what P is! From the error msg, I can see that it's not a string, but I can't begin to guess what it might be....
Also, looking at the Matlab documentation, it seems to suggest that the function strsplit() should work the way that I expect: the first argument is a string.
(I also notice in the documentation for the various string functions, that sometimes "s" is used for the parameter string and sometimes "str". It should be consistent.)
Here is the output that I find unhelpful:
>> strsplit('foo bar baz')
error: Invalid call to strsplit. Correct usage is:
-- Function File: [S] = strsplit (P, SEP, STRIP_EMPTY)
>> help strsplit
`strsplit' is a function from the file /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/strings/strsplit.m
-- Function File: [S] = strsplit (P, SEP, STRIP_EMPTY)
Split a single string using one or more delimiters and return a
cell array of strings. Consecutive delimiters and delimiters at
boundaries result in empty strings, unless STRIP_EMPTY is true.
The default value of STRIP_EMPTY is false.
See also: strtok
|