bugGNU Octave - Bugs: bug #37131, string constants handled...

 
 

bug #37131: string constants handled differently than in Matlab (input function doesn't handle newlines correctly)

Submitted by:  None
Submitted on:  Fri 17 Aug 2012 01:31:58 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: InvalidAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.1
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 18 Aug 2012 02:39:39 AM UTC, comment #1:

This is not a bug but a documented feature in Octave.
See section 5.1 in the Octave manual to see how string
constants are treated differently in Octave with respect
to Matlab.

If you want that code to work as you expect you should rewrite it as

or, if you want it to work both in Octave AND Matlab, as

Carlo de Falco <cdf>
Project Member
Fri 17 Aug 2012 01:31:58 PM UTC, original submission:

I issue the following:

and I get

rather than the expected

That is, the newline character is treated as text rather than as a newline character.

I have compared with Matlab, and indeed in Matlab I get the latter (expected) behavior. Note that Matlab's help explicitly states that newlines are supported, while Octave's doesn't (and apparently, indeed it doesn't).

I am using Octave 3.6.1, compiled from source on 64-bit Ubuntu 11.10, and Matlab R2010a.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cdf (Posted a comment)
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 18 Aug 2012 02:39:39 AM UTCcdfCategoryNone=>Interpreter
      Item GroupIncorrect Result=>Matlab Compatibility
      StatusNone=>Invalid
      Open/ClosedOpen=>Closed
      Operating SystemGNU/Linux=>Any
      Summaryinput function doesn\'t handle newlines correctly=>string constants handled differently than in Matlab (input function doesn't handle newlines correctly)

    Back to the top


    Powered by Savane 3.1-cleanup1