|
From: | Glen Shennan |
Subject: | Re: dimension slice |
Date: | Fri, 7 Jan 2011 19:33:18 +1100 |
On 6 January 2011 21:40, Glen Shennan <address@hidden> wrote:A less flippant answer might be to use permute to bring the two
> You mean matrix(1,:,:) Yes, that worked, cheers. But is there a way to do
> it in the n-dimensional case?
dimensions you care about to the front and linearise the index for the
position you want, then mat(:,:,linear_index) will also give you a
matrix at that position.
Or you could do what you were originally doing and call reshape on it
in order to turn it into a 2x2 matrix.
- Jordi G. H.
[Prev in Thread] | Current Thread | [Next in Thread] |