# 2.2.2.2 mdim

## Contents

Matrix: Set Dimensions/values

## Brief Information

Set matrix dimensions and XY coordinates

## Command Line Usage

 1. mdim ms:=MSheet1 cols:=10 rows:=10; 

2. mdim c:=10 r:=10 x1:=0 x2:=9 y1:=0 y2:=9; 

## Variables

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

Input/Output

MatrixLayer

<active>

Specifies the matrix sheet to be manipulated.

Columns cols

Input

int

<auto>

Specifies the number of columns.

Rows rows

Input

int

<auto>

Specifies the number of rows.

First X x1

Input

double

<auto>

Specifies the value of the first X coordinate.

Last X x2

Input

double

<auto>

Specifies the value of the last X coordinate.

First Y y1

Input

double

<auto>

Specifies the value of the first Y coordinate.

Last Y y2

Input

double

<auto>

Specifies the value of the last Y coordinate.

## Description

You can use this X-Function to control the number of rows and columns and the X and Y (column and row) mapping arrangement for matrices.

Row and column numbers are positive integers. They determine the number of cells in the matrix. If a matrix is a numeric matrix, you can use this X-Function to change the dimension. However, you cannot change the dimensions for images.

The X and Y coordinates of matrix data are assumed to be evenly spaced. When you set the first and last X, the first X is mapped to the first column and the last X is mapped to the last column. The X coordinates of other columns will be linearly mapped. Similar mapping applies to rows, but the first Y and the last Y are used. For a point that corresponds to a matrix cell, its position in 3D space is determined by the X and Y coordinates of this cell, as well as the Z value that is saved in the cell. When matrix data is plotted or analyzed, the XY coordinates, instead of the row and column numbers, will be used.

## Examples

1. Create a new matrix by clicking the New Matrix button on Standard toolbar.
2. Select Matrix: Set Dimensions from the Origin menu to open the dialog of mdim.
3. In the dialog, enter 10 for Columns and Rows, 2 for First X and First Y and 20 for Last X and Last Y. Click OK to close the dialog.
4. Select View: Show X/Y from the menu to view the coordinates.

Keywords:scale, calibrate, calibration