Yoel Jacobsen wrote:
> I have three boxed matrices and I want to transpose only the last one.
If this is your use case, I recommend (}: , |:&.>@:{:) .
> Is there a way for instance, to apply ;:'[ [ |:' to (i.10 10);(i. 10 10);
> i.10 10
In this generic sense, the cut conjunction ;. may be used to apply
different verbs at different indices of a noun.
In this case,
V =. 1 [@:{.`([@:{.)`(|:&.>@:{.);.1 ]
y =. (i.10 10);(i. 10 10); i.10 10
V y
But, as you can see, it's a bit ugly. It was prettier and easier in earlier
versions of J, and I've written a script that emulates that behavior. In
particular, you want the adverb "AcrossBoxed":
load'doog'
[`[`|: AcrossBoxed (i.10 10);(i. 10 10); i.10 10
More examples and the script itself are on the wiki:
http://www.jsoftware.com/jwiki/DanBron/Snippets/DOOG
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
View this message in context:
http://www.nabble.com/How-to-apply-different-verbs-to-a-boxed-sequence--tp14918558s24193p14919684.html
Sent from the J Programming mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm