help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: input with line break


From: Przemek Klosowski
Subject: Re: input with line break
Date: Fri, 4 Oct 2019 16:00:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 10/3/19 5:12 PM, Santiago Higuera wrote:
Hi all:

I'm using Ocatve 5.1, and I've observed that if I use:

x=input("x= \n")

The special character '\n' is recognized, but if I use single quoted string, it is not recognized.

Is it a bug? In MATLAB single quoted string recognize the special character for line break in input() function.

I don't consider it a bug---it's a convention used in many other places (e.g. the shell)

Matlab disregards escape characters in both forms, but seems to special-case escape characters (at least \n) in input(). Octave doesn't need to because you can pass them in double-quoted strings.

It is a minor Octave-Matlab incompatibility but I just think Octave does it better. Are there other known cases of special-casing escapes in Matlab?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]