> On 1/18/06, David Bateman <[hidden email]> wrote:
> > I'd think the following example is something like what you want
> Nice example. Thank you. Pairing a bunch of toy m-functions with the
> corresponding oct-functions would make a nice document.
> Since I can only index a NDArray with a single index, how do I pull
> out an entire 2D slice of a 3D array?
> n = [3 2 4];
> x = rand(n);
> I want y = x(:,:,j), so in an oct function would I have to do the
> equivalent of
> ind = (j - 1)*n(1)*n(2) + (1:(n(1)*n(2)));
> y = x(ind);
> y = reshape(x,n(1),n(2));
> or if reshape is not available loop over the rows and columns of y?
With idx_vector's in an oct-file you can do this. But not very