Determining the dimensions of a matrix programmatically

This macro determines the dimensions of a matrix. For a given matrix A, the macro returns the number of columns 'm' and the number of rows 'n'.

This macro determines the dimensions of a matrix. For a given matrix A, the macro returns the number of columns 'm' and the number of rows 'n'.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose File > Options > General. Under Macro location browse to the location where you save macro files.

Important

If you use an older web browser, when you click the Download button, the file may open in Quicktime, which shares the .mac file extension with Minitab macros. To save the macro, right-click the Download button and choose Save target as.

Required Inputs

  • A matrix

Optional Inputs

STORE K K
Use to store the number of rows and columns in two constants (K K).

Running the Macro

Suppose the matrix is in M1. To run the macro, choose View > Command Line/History and type:

%SIZE M1

Click Run.