Date: Tue, 12 Jun 2007 11:45:53 -0400
From: "Will Slade" <[EMAIL PROTECTED]>

I can return the first dimension of A like so: A[1;;]

Is there a way to return the nth dimension of A without knowing what the
dimensions of A are?

Assuming apl*plus iii has dyadic transpose (I think they all have) you can extract i-th slice along n-th axis using equivalent of {.i|.(n|.i.#$A) |: A without using [] indexing.

For example,
  A=.2 3 4$i.!4
  {.3|.(2|.i.#$A) |: A
3  7 11
15 19 23

_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to