# 2.2.2.9 mshrink

Matrix: Shrink

## Brief Information

Combine or remove rows or columns of matrix by specified factor

## Command Line Usage

 1. mshrink 

2. mshrink cols:=2 rows:=1 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Matrix m

Input

MatrixObject

<active>

Specifies the input matrix.

Col Factor cols

Input

int

2

Specifies a factor to reduce the number of columns. For example, if Col Factor is 2, every two columns in the input matrix will be shrinked into one column.

Row Factor rows

Input

int

2

Specifies a factor to reduce the number of rows. For example, if Row Factor is 2, every two rows in the input matrix will be shrinked into one row.

Shrink Method method

Input

int

2

According to the column factor and row factor, define the shrinked sub-range of the cells in the Matrix. For example, if Col Factor is 2 and Row Factor is 2, four cells (from every two columns and every two rows) will be a sub-range .

This option specifies which value will be output when shrinked.
Option list:

• 0: KeepFirstCell :
Keep the first cell in the shrinked sub-range of the cell.
• 1: KeepLastCell:
Keep the last cell in the shrinked sub-range of the cell.
• 2: Average:
Output the average from the shrinked sub-range of the cell.
• 3: Sum:
Output the sum from the shrinked sub-range of the cell.
• 4:Max
Output the maximum value fom the shrinked sub-range of the cell.
• 5: Min
Output the minimum value from the shrinked sub-range of the cell.
• 6:SD
Output the standard deviation from the shrinked sub-range of the cell.
Output Matrix om

Output

MatrixObject

<input>

Specifies the output matrix.

See the syntax here.

## Description

This X-Function can be used to Combine or remove the number of columns and rows of a matrix.

Keywords:shrink