cp =: (<1 1)&{   NB. center pixel of 3x3
tess =: 2 2$3    NB. tesselate
trim =: >@(tess &(cp;._3))@:(<"1)
trim =: ,"_2@(tess &(cp;._3))@:(]"1)

​I have found the trim's above both accomplish the desired result. My
question especially is, how can the rank "1 in the latter ​trim be
incorporated without the trailing @(). Any other suggestions to achieve
speed improvements would be appreciated, too.

I am experimenting with the following phrase, for example, and when
applying rank directly, without the @:() I get length error.

trim i. 7 10 3   NB. a fake rgb image argument

​Thank you,​

-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to