Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Matrix.New

Creates a new matrix (2D array).

Component Version macOS Windows Linux Server iOS SDK
Matrix 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Matrix.New"; Height; Width )   More

Parameters

Parameter Description Example
Height The height of the matrix. 3
Width The width of the matrix. 4

Result

Returns matrix reference number or error.

Description

Creates a new matrix (2D array).
Please call Matrix.Release later to free the matrix object.

Internally we store all data in FileMaker data types, so times, dates, timestamps, numbers and containers are preserved as they are and not converted to texts.

Examples

Creates a matrix:

Set Variable [ $matrix ; Value: MBS( "Matrix.New"; 3; 4 ) ]
Show Custom Dialog [ "Size" ; MBS( "Matrix.Width"; $matrix ) & " x " & MBS( "Matrix.Height"; $matrix ) ]
Set Variable [ $r ; Value: MBS( "Matrix.Release"; $matrix ) ]

Create and set columns:

Set Variable [ $matrix; Value: MBS("Matrix.New";3;3) ]
# Set the values of the matrix
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 0;"15¶07¶92" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 1;"17¶3¶60" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 2;"15¶1¶87" ) ]

See also

Blog Entries

This function checks for a license.

Created 8th April 2019, last changed 2nd November 2020


Matrix.Multiply - Matrix.NewWithSQL