I understand the sentiment, but when it's more concise, faster and leaner, it is hard to ignore!
On Sat, 14 Nov 2020, 09:37 Henry Rich, <[email protected]> wrote: > /Et tu, R. E.?/ > > Using $. for this is using a sledgehammer to crack an egg. > > Henry Rich > > On 11/13/2020 3:00 PM, R.E. Boss wrote: > > $.$.M > > 0 0 │ 1 > > 0 1 │ 2 > > 0 2 │ 3 > > 0 3 │ 4 > > 1 0 │ 5 > > 1 1 │ 6 > > 1 2 │ 7 > > 1 3 │ 8 > > 2 0 │ 9 > > 2 1 │ 10 > > 2 2 │ 11 > > 2 3 │ 12 > > > > > > R.E. Boss > > > > > > -----Original Message----- > > From: Programming <[email protected]> On Behalf > Of thomas.bulka via Programming > > Sent: vrijdag 13 november 2020 18:05 > > To: [email protected] > > Subject: [Jprogramming] Getting indices of matrix elements > > > > Hi everyone, > > > > still learning J, I stumbled across a problem which should be easy to > solve, but somehow I have not been able to do so, yet. Say, I have defined > a matrix M: > > > > M =: 3 4 $ >: i. 12 > > > > I now want to get the row and column index of 6 in M, which is 1 2. If M > was a vector, I could easily get the index of 6 with the help of I.: > > > > I. 6 = , M > > > > Applying I. to M in its original shape, however, returns a boolean > vector which indicates in which rows 6 has been found (at least that is my > interpretation). > > > > Is it possible to apply I. to higher rank arrays in order to receive the > complete indices of the elements I'm looking for? Or should I approach that > problem in another way? > > > > Thank you very much in advance for your help! > > > > Kind regards, > > > > Thomas > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > -- > This email has been checked for viruses by AVG. > https://www.avg.com > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
