2.2.2.15 mshrink

Menu Information

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

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

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 shrank 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 shrank into one row.

Shrink Method method

Input

int

2

According to the column factor and row factor, define the shrink 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 shrank.
Option list:

  • 0: KeepFirstCell :
    Keep the first cell in the shrank sub-range of the cell.
  • 1: KeepLastCell:
    Keep the last cell in the shrank sub-range of the cell.
  • 2: Average:
    Output the average from the shrank sub-range of the cell.
  • 3: Sum:
    Output the sum from the shrank sub-range of the cell.
  • 4:Max
    Output the maximum value fom the shrank sub-range of the cell.
  • 5: Min
    Output the minimum value from the shrank sub-range of the cell.
  • 6:SD
    Output the standard deviation from the shrank 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.

Related X-Functions

mdim, mexpand, mproperty, mreplace, mrotate90, msetvalue, mflip, mtranspose , msmooth


Keywords:shrink