PhraseBook/FindInMatrix

This phrase is searching a pattern in a matrix an return pairs of (row, column) in a vector for every hit.

      ⊂[⎕IO+1]⍉(⍴AM)⊤v/⍳⍴v←AV⍷,AM      

Examples

      ⎕FX ⍕2 1⍴'r←AM FindInMatrix AV;b' '  r←⊂[⎕IO+1]⍉(⍴AM)⊤v/⍳⍴v←AV⍷,AM'
      M←''
      M←M,⊂'January'  
      M←M,⊂'February' 
      M←M,⊂'March'    
      M←M,⊂'April'    
      M←M,⊂'May'      
      M←M,⊂'June'     
      M←M,⊂'July'     
      M←M,⊂'August'   
      M←M,⊂'September'
      M←M,⊂'October'  
      M←M,⊂'November' 
      M←M,⊂'December' 
      M←⊃M
      M FindInMatrix 'em'
 (8 4) (10 3) (11 3)
      M FindInMatrix'nuar'
 0 2 

Compatibility

Checked with: APLX, NARS2000

See also: ...

Mentor: KaiJaeger

Tags:


CategoryPhrasesAll

PhraseBook/FindInMatrix (last edited 2016-03-26 16:28:27 by KaiJaeger)