[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dimension slice

From: Jordi Gutiérrez Hermoso
Subject: Re: dimension slice
Date: Fri, 7 Jan 2011 00:14:49 -0600

On 6 January 2011 21:40, Glen Shennan <address@hidden> wrote:
> You mean matrix(1,:,:)   Yes, that worked, cheers.  But is there a way to do
> it in the n-dimensional case?

A less flippant answer might be to use permute to bring the two
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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]