From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 28 14:15:14 1998 Subject: parsing problem. Bug? From: Andy Adler To: help-octave at bevo dot che dot wisc dot edu 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 adlera at njc dot org| | National Jewish Center,Denver,USA | 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"