From bug-octave-request at bevo dot che dot wisc dot edu Wed Oct 20 22:04:56 1999 Subject: Parsing bug in diag (2.0.14) From: A+A Adler To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 20 Oct 1999 22:03:57 -0500 (CDT) I just noticed a bizzare effect using diag. If you use it in the mode diag(vector,x), the vector needs either [] brackets around it, or it needs a more complicated expression (1:2)+1 Transcript follows octave:1> diag(1:2) ans = 1 0 0 2 octave:2> diag(1:2,1) error: diag: wrong type argument `range' error: evaluating index expression near line 2, column 1 octave:2> diag([1:2],1) ans = 0 1 0 0 0 2 0 0 0 octave:3> diag((1:2),1) error: diag: wrong type argument `range' error: evaluating index expression near line 4, column 1 octave:3> diag((1:2)+1,1) ans = 0 2 0 0 0 3 0 0 0 octave:4> version ans = 2.0.14 ______________________________________________________________ Andy Adler, adler at mondenet dot com --------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. To ensure that development continues, see www.che.wisc.edu/octave/giftform.html Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html ---------------------------------------------------------------------