help-octave
[Top][All Lists]
Advanced

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

Re: Why the parse error?


From: pantxo diribarne
Subject: Re: Why the parse error?
Date: Tue, 5 Feb 2013 17:47:31 +0100

Hi,

In this concatenation form, a line vector may be written with coma or space separated values:
octave> [1 2]
ans =

   1   2

octave> [1, 2]
ans =

   1   2

Here I suppose the parser splits the _expression_ between the braquets using space (and ;) separator, and sees an invalid Octave _expression_ : (1, 1). You have to remove the space between "rand" and "(1, 1)" or add paranthesis if you want to keep the separation between function and arguments : [1; (rand (1, 1))]

Pantxo




reply via email to

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