Actually, I don’t know either.

I just wove together something I think is way too much work
for this simple task:

+/@(* i.@#)"1 (+/ ,: +/"1) (6 E."0 1 M)

Any suggestions?

Am 13.11.20 um 18:05 schrieb thomas.bulka via Programming:
> 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
> 

-- 
----------------------
mail written using NEO
neo-layout.org

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

Reply via email to