Actually the rank in the previous result has to be altered. ;/1([(1 0 2&|:)@(|."_1)(1 0 2&|:)@]) i.5 4 3
But Ric's solution may be the simplest (it came while I was investigating this one). The problem may be that I really need another rotation like the one in the previous message without the rank change. I'll look further into that. I am trying to rotate rows and columns to center an object in a jpeg image of shape (r,c,3), by the way. On Tue, May 30, 2017 at 7:19 AM, Brian Schott <[email protected]> wrote: > I may have a solution, as this suggests, but I am unable to use "under" > here. > > ;/1([(1 0 2&|:)@|.(1 0 2&|:)@]) i.5 4 3 > > On Tue, May 30, 2017 at 7:00 AM, Brian Schott <[email protected]> > wrote: > >> The following expression accomplishes my goal when the array on the right >> (i. 5 4 3 here) needs to be rotated by 1, the leftmost 1. But I want that 1 >> to be an argument, also. >> >> ;/(1|."_1]) &. (1 0 2&|:)i.5 4 3 >> >> But my attempts such as the following, produce errors. >> Can you suggest a solution, preferably tacit? >> >> ;/1(([|."_1]) &. (1 0 2|:]))i.5 4 3 >> |index error >> | ;/1 (([|."_1])&.(1 0 2|:]))i.5 4 3 >> >> Thanks, >> >> >> -- >> (B=) >> > > > > -- > (B=) <-----my sig > Brian Schott > -- (B=) <-----my sig Brian Schott ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
