From help-request at octave dot org Mon Feb 7 13:33:02 2005 Subject: Re: indexing From: mavram at bezeqint dot net To: "Seba T." Cc: help-octave at bevo dot che dot wisc dot edu Date: Mon, 7 Feb 2005 21:37:14 +0200 On Mon, Feb 07, 2005 at 06:08:23AM -0600, Seba T. wrote: > hi i was wondering about simple funciont like this example one > > for i=101:200 > minusjeden(i)=minusjeden(i-1)+1/100; > end; > > it works in matlab but in octave it complains that "i-1" for "i"=101 will give > the value 100 which will be outside of the range given by "for" statement. I > can use "if" statement to avoid the commands to be executed when i=100 but is > there a way i could switch the range checking off ? > > -- > Powered by Yoper Linux > kernel 2.6.8 ; kde 3.3-1 > > www.303.prv.pl > Jeśli musisz być pod winblowsem używaj www.firefox.pl > Hi, I tried: nusjeden=zeros(1,200); % (I have to define minusjeden somewhow before I use it. I don't % know how you defined it) for i=101:200 > minusjeden(i)=minusjeden(i-1)+1/100; > end No complaints. Octave 2.1-57 on Debian testing/unstable. Cheers, Avraham > > ------------------------------------------------------------- > 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 > ------------------------------------------------------------- > ------------------------------------------------------------- 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 -------------------------------------------------------------