From bug-request at octave dot org Thu Mar 16 10:42:30 2006 Subject: Re: hurst.m From: "John W. Eaton" To: Francesco Potorti` Cc: Octave bugs list Date: Thu, 16 Mar 2006 11:42:13 -0500 On 16-Mar-2006, Francesco Potorti` wrote: | >| The following expressions index a as if it were a column vector. If the | >| indexing expression is a vector, the dimensions of the output will match | >| those of the vector: | >| a(1:2) | >| a(:) | >| a([1;2]) | > | >When I read this, I'm not sure whether the last "vector" is intended | >to refer to the object that is indexed, or the index vector. | | Let's try again. Instead of the current text: | | Vectors are indexed using a single expression. Matrices may be indexed | using one or two indices (a warning is issued if a single index is used | unless the value of the built-in variable `warn_fortran_indexing' is | zero). | | Use this one: | | Vectors are indexed using a single index expression. Matrices may be | indexed using one or two indices. When using a single index | expression, the elements of the matrix are taken in column-first order; | the dimensions of the output match those of the index expression: | A(2) # a scalar | A(1:2) # a row vector | A([1;2]) # a column vector | | As a special case, when a colon is used as a single index, the output | is a column vector containing all the elements of A: | A(:) # a column vector | | A warning is issued when using a single expression to index a matrix, | unless the value of the built-in variable `warn_fortran_indexing' is | zero. I made these changes to the manual. Thanks, 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 -------------------------------------------------------------