Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » Matrix » compress
next | previous | forward | backward | up | index | toc

# compress -- extract nonzero columns from a matrix

- Usage:
    `compress m`
- Inputs:
  - m, a matrix
- Outputs:
  - a matrix, the matrix consisting of nonzero columns of m

## Description

    i1 : m = matrix {{1,2,0,0},{0,0,1,0}}

    o1 = | 1 2 0 0 |
         | 0 0 1 0 |

                  2       4
    o1 : Matrix ZZ  <-- ZZ

    i2 : compress m

    o2 = | 1 2 0 |
         | 0 0 1 |

                  2       3
    o2 : Matrix ZZ  <-- ZZ

## See also

- matrices

## Ways to use compress:

- `compress(Matrix)`

## For the programmer

The object compress is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/compress-doc.m2:21:0.