From bug-octave-request at bevo dot che dot wisc dot edu Fri Dec 12 21:49:34 2003 Subject: Re: more indexing weirdness From: Andy Adler To: Etienne Grossmann cc: Paul Kienzle , Date: Fri, 12 Dec 2003 22:49:00 -0500 (EST) On Fri, 12 Dec 2003, Etienne Grossmann wrote: > for this, you may want to use loop_add() below: > > octave:4> loop_add ([0 0 0],[2 2 2 2 1],[1 1 1 1 1]) > ans = > > 1 4 0 BTW, you can also use sparse to do this octave:5> full( sparse( 1,[2 2 2 2 1],[1 1 1 1 1],1,3)) ans = 1 4 0 Andy ------------------------------------------------------------- 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 -------------------------------------------------------------