From help-octave-request at bevo dot che dot wisc dot edu Sat Dec 27 16:58:37 2003 Subject: Re: Syntax befuddlement From: "Dmitri A. Sergatskov" To: Joe Koski Cc: Octave_post Date: Sat, 27 Dec 2003 15:59:22 -0700 Joe Koski wrote: > > > octave:2> t=[0.002:0.001:0.007] > t = > > 0.0020000 0.0030000 0.0040000 0.0050000 0.0060000 0.0070000 > > octave:3> fnormhat=0.5*(angle(-x(t+1).*conj(x(t-1)))+pi)/(2*pi) ^^^ ^^^^ t here is an index for x vector. For your t, t-1 is rounded to -1 and x(-1) is undefined (index should be a positive integer)... > error: invalid vector index = -1 > error: evaluating argument list element number 1 ... Also conj(x)==x, if x is real. Regards, Dmitri. ------------------------------------------------------------- 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 -------------------------------------------------------------