[Top][All Lists]

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

Re: dimension slice

From: Glen Shennan
Subject: Re: dimension slice
Date: Fri, 7 Jan 2011 14:40:55 +1100

You mean matrix(1,:,:)   Yes, that worked, cheers.  But is there a way to do it in the n-dimensional case?

On 7 January 2011 14:36, Doug Stewart <address@hidden> wrote:

On Thu, Jan 6, 2011 at 10:32 PM, Glen Shennan <address@hidden> wrote:

I am trying do address n-dimensional matrices one dimension at a time.  If I have (say) a 4x4x4 matrix and want to get the square matrix referenced by matrix(1) = [a 4x4 matrix] I can use matrix(1,:) but this returns a row vector containing all 16 elements that are in the slice, not the shaped matrix.  Is there a way to slice an n-dimension matrix (using only the first index) so that a shaped matrix is returned?

Glen Shennan

Help-octave mailing list

try  matrix(1,;,;)

reply via email to

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