To understand your problem

Do you need the data in the changed form
    that is do you need the line 61 71 73 to exist after your operation

or
    is it just a temporary operation and what you really need is to know if
the two last numbers are equal so you can report 3 or 4?

If it is the latter and you want to just find out 3 or 4 but not needing to
do the compare you might add a fifth column to hold the number 3 or 4 as
appropriate - assuming that the matrix needs to be around after the
operation of course

Then you could either keep the fourth item in case they are equal or replace
it with something else

It is always better to know the whole prcocess and not just subtask whic may
or may not be needed


2006/3/20, Vladimir Lazunin <[EMAIL PROTECTED]>:
>
> 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
>



--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23,
Skype: gosiminn, gsm: +3546985532
802 Selfoss ,t-póst: [EMAIL PROTECTED]
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.

         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |
  (`-.  '--.)
   `. )----'
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to