next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > lists and sequences > subtable

subtable -- extract a subtable from a table

Description

subtable(u,v,m) -- yields the subtable of the table m obtained from the list u of row numbers and the list v of column numbers.

i1 : m = table(5,5,identity)

o1 = {{(0, 0), (0, 1), (0, 2), (0, 3), (0, 4)}, {(1, 0), (1, 1), (1, 2), (1,
     ------------------------------------------------------------------------
     3), (1, 4)}, {(2, 0), (2, 1), (2, 2), (2, 3), (2, 4)}, {(3, 0), (3, 1),
     ------------------------------------------------------------------------
     (3, 2), (3, 3), (3, 4)}, {(4, 0), (4, 1), (4, 2), (4, 3), (4, 4)}}

o1 : List
i2 : subtable({1,3,4},toList(2..4), m)

o2 = {{(1, 2), (1, 3), (1, 4)}, {(3, 2), (3, 3), (3, 4)}, {(4, 2), (4, 3),
     ------------------------------------------------------------------------
     (4, 4)}}

o2 : List