help-octave
[Top][All Lists]
Advanced

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

parsing problem. Bug?


From: Andy Adler
Subject: parsing problem. Bug?
Date: Wed, 28 Jan 1998 13:21:46 -0700 (MST)

I've had the following parsing problem. I get the same
error in octave 2.0.9 and 2.1.2.

if you try to define a vector
  
  octave:69> a=b=c=d=1;
  octave:70> [a b (c+d)]
  error: invalid vector index = 2
  error: evaluating index expression near line 70, column 5

If you bracket the b the answer is wrong
  octave:70> [a (b) (c+d)]
  ans = 1  2

You need to give everything brackets
  octave:71> [(a) (b) (c+d)]
  ans =
    1  1  2
  
I realize that the right_thing_to_do (tm) is use commas to
separate elements, but I think this behaviour is a bug.

PS. In matlab you get
  >> [a b (c+d)]
  ans = 1     1     2

_____________________________________________________________________
Andy Adler,    | Pulmonary Physiology Unit         | Lab 303-398-1626
address@hidden | National Jewish Center,Denver,USA | Fax 303-398-1607

Unfortunately, the facts pay no attention to what we can imagine.
                             -Geza Szamosi, "The Twin Dimensions"



reply via email to

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