I have a matrix of integers, there are 4 columns and any numberof rows. In
any of the rows two last numbers could be equal. If so, one should be
removed. I.e., for example, this:
61 72 73 73
2 3 50 49
should turn to:
61 72 73
2 3 50 49
Or, rather:
+--------+---------+
|61 72 73|2 3 50 49|
+--------+---------+
I've managed to do that for a single row by defining (probably, really
ugly):
er_if =: 3 : '(y. -. 3 { y.),(3 { y.)'
What I need is to get rid of those trailing 0-s when I aply it to the entire
matrix. I plan to use # on it later and I need it to return 3 or 4,
respectively, not always 4.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm