Take a look at what the ranks are you are applying

   a=.3 4$1 2 3 4
+/"1 a
10 10 10
   +"1/a
3 6 9 12
+/"1 b. 0
1 1 1
   +"1/ b. 0
_ _ _
   +"1 b. 0
1 1 1

2010/4/29 Robert O'Boyle <bcu...@accesswave.ca>:
> II have come across a feature of J that I didn't expect. When I add rows of
> a matrix, I use +/"1
>
>   a
>
> 1 2 3 4
>
> 1 2 3 4
>
> 1 2 3 4
>
>
>
>   +/"1 a
>
> 10 10 10
>
>
>
> And columns,
>
>  +/"2 a
>
> 3 6 9 12
>
>
>
> By chance, I happened to 'misplace' insert and got an unexpected result
>
>
>
>   +"1/a
>
> 3 6 9 12
>
>
>
> which is the addition of the columns. However,
>
>
>
>   +"2/ a
>
> 3 6 9 12
>
>
>
> Now take another matrix b
>
>   b
>
> 1 1 1 1
>
> 2 2 2 2
>
> 3 3 3 3
>
> 4 4 4 4
>
>
>
> I would like to multiply every row of b by every row of a, but
>
>
>
>   a*/"1 b
>
> |length error
>
> |   a    */"1 b
>
>
>
> While
>
>
>
>   a*"1 / b
>
> 1 2  3  4
>
> 2 4  6  8
>
> 3 6  9 12
>
> 4 8 12 16
>
>
>
> 1 2  3  4
>
> 2 4  6  8
>
> 3 6  9 12
>
> 4 8 12 16
>
>
>
> 1 2  3  4
>
> 2 4  6  8
>
> 3 6  9 12
>
> 4 8 12 16
>
>
>
> Which appears to work.
>
>
>
> I am obviously missing something with rank and insert. Could someone
> enlighten me? Any insight is much appreciated, as always.
>
>
>
> Bob
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: gos...@gmail.com
gsm: +3546985532
sími: +3544781286
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