help-octave
[Top][All Lists]
Advanced

[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 19:33:18 +1100

"Octave Nd-arrays should be used sparingly. Octave is highly optimised
for ordinary matrices, not Nd-arrays. Okay, maybe Jaroslav optimised
Nd-arrays much more while I wasn't looking, but Nd-arrays of high
dimensionality are still in general somewhat awkward. Stick to normal
matrices."

Good information to have, thanks.

As for the rest I'll give it a go but I might just stick to the above too.  Thanks for the help!

Glen

2011/1/7 Jordi Gutiérrez Hermoso <address@hidden>
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]