From bug-octave-request at bevo dot che dot wisc dot edu Thu Dec 11 23:12:52 2003 Subject: indexing error From: "John W. Eaton" To: Paul Kienzle Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 11 Dec 2003 23:12:49 -0600 On 11-Dec-2003, Paul Kienzle wrote: | octave-2.1.52, Debian linux package | | octave:18> x=eye(2); x([1,1,1,1,1])=1 | error: A(I) = X: X must be a scalar or a matrix with the same size as I | error: assignment failed, or no method for `matrix = scalar' | error: evaluating assignment expression near line 18, column 25 OK, this should produce x = 1 0 0 1 since it should be equivalent to writing x(1) = 1 x(1) = 1 x(1) = 1 x(1) = 1 x(1) = 1 | octave:18> x=eye(2); x([1,1,1,1])=1 | x = | 1 0 | 0 1 | | octave:19> x=[1:4]; x([1,1,1,1,1])=1 | x = 1 2 3 4 I think these are correct. jwe ------------------------------------------------------------- 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 -------------------------------------------------------------