From: Jonathan Stickel <address@hidden>
Reply-To: address@hidden
To: Ryan Peterson <address@hidden>
CC: address@hidden
Subject: Re: Attacking ND arrays
Date: Wed, 22 Jun 2005 12:56:33 -0700
Maybe you want to use the squeeze command.
octave:7> help squeeze
squeeze is a built-in function
-- Built-in Function: squeeze (X)
Remove singleton dimensions from X and return the result.
Ryan Peterson wrote:
Is there a "good" way to take 2d slices of ND matrices, either in
octave-forge or upcoming in future versions of octave? Say I have a 4d
matrix named foo with 5 values in each direction and I want to look at a
slice of it. Intuitively, I went for this:
b=foo(4,3,:,:);
imagesc(b)
But got an error about transposing ND arrays. I remember reading
something about someone doing this within C but am curious if and how
people have done this in octave. The most straightforward method I can
think of is a loop but that can be time consuming. Any
recommendations/suggestions?
Thanks,
Ryan Peterson
-------------------------------------------------------------
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
-------------------------------------------------------------