[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matrix index, Please e-mail back.
From: |
Joan Picanyol i Puig |
Subject: |
Re: Matrix index, Please e-mail back. |
Date: |
Sat, 16 Dec 2006 12:37:23 +0100 |
User-agent: |
Mutt/1.5.11 |
* Paul Kienzle <address@hidden> [20061206 03:36]:
>
> On Dec 5, 2006, at 6:39 PM, Jordi Gutierrez Hermoso wrote:
>
> > There are cute little indexing hacks that can be accomplished if you
> > remember that Octave stores matrices in Fortran column-major order. In
> > other words, a matrix can be indexed by a single index as if it were
> > one long vector.
>
> The functions sub2ind and ind2sub hide the details, letting you
> access an array element by element rather than by slices.
Could you please share some hints as how are they to be used? The docs
are a bit too concise for my taste: what is "DIMS" supposed to be? What
about "S1, ..., SN"? I've started to use indexing heavily as of late,
but have been unable to use sub2ind and ind2sub, I tipically get an
"index out of range" error (see
http://www.cae.wisc.edu/pipermail/help-octave/2006-October/001983.html )
tks
--
pica