help-octave
[Top][All Lists]
Advanced

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

Re: Whitespace question, [zeros (1, 2), ones (1, 2)]


From: Mike Miller
Subject: Re: Whitespace question, [zeros (1, 2), ones (1, 2)]
Date: Sat, 5 Nov 2005 19:40:41 -0600 (CST)

On Sat, 5 Nov 2005, Paul Roberts wrote:

I think that the problem in this case is the way octave parses array declarations. In an array declaration, whitespace is treated as an element delimiter. For example:

a = [1 2 3]
a =

 1  2  3

So when you try:

[ones (1,2)]

octave treats it like

[ones,(1,2)]


I checked, and both expressions give the same syntax error that you mentioned above. So the whitespace between function name and arguments won't work inside of an array declaration.


Interesting problem.  I do not get the parse error on this old version:

GNU Octave, version 2.0.14 (sparc-sun-solaris2.6)

But I do get it on this newer version:

GNU Octave, version 2.1.71 (i686-pc-linux-gnu)

John will probably have something to add.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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