bugGNU Octave - Bugs: bug #42400, examples in documentation for...

 
 

bug #42400: examples in documentation for strsplit do not work. Alternate implementation does

Submitted by:  None
Submitted on:  Wed 21 May 2014 03:45:03 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: InvalidAssigned to: None
Originator Name: Barry SolomonOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31412:  octave image.png added by None (48KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 21 May 2014 03:50:43 PM UTCjordighStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Wed 21 May 2014 03:45:03 PM UTCNoneAttached File-=>Added octave image.png, #31412

    Back to the top


    Powered by Savane 3.1-cleanup1