help-octave
[Top][All Lists]
Advanced

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

Re: subarray(x, d, k) for picking all k-th elements of d-th dimension o


From: G..
Subject: Re: subarray(x, d, k) for picking all k-th elements of d-th dimension of x ?
Date: Fri, 24 Apr 2009 03:37:35 -0700 (PDT)


Jaroslav Hajek-2 wrote:
> 
> Well, no, but you can write it:
> 
> idx = {':'}(ones (1, max (ndims (x), d))); idx{d} = k; % or anything
> y = x(idx{:});
> 

Great! I think I got a glimpse about indexing now. I never found it
documented.

G.

-- 
View this message in context: 
http://www.nabble.com/subarray%28x%2C-d%2C-k%29-for-picking-all-k-th-elements-of-d-th-dimension-of-x---tp23212405p23213782.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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