From octave-maintainers-request at bevo dot che dot wisc dot edu Mon Aug 21 02:19:03 2000 Subject: Re: proper lvalues and whatnot From: "John W. Eaton" To: "Ross A. Lippert" Cc: "John W. Eaton" , "octave-maintainers@bevo.che.wisc.edu" Date: Mon, 21 Aug 2000 02:17:03 -0500 (CDT) On 18-Aug-2000, Ross A. Lippert wrote: | To me, and maybe not to anyone else, what seems mmore logical is | v(I) += x(I) should be implemented as | for i=1:length(I), v(I(i)) += x(I(i)); end That might be nice in some instances, but I think Octave must behave as though a(idx) += b and a(idx) = a(idx) + b are equivalent. I'm afraid that the behavior of the second statement is not equivalent to your loop if idx has repeated values. jwe