Matrix.New
----------

Creates a new matrix (2D array).

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Matrix](component_Matrix.md) | [9.2](newinversion92.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Matrix.New"; Height; Width ) 

**MBS**( **"Matrix.New";** /\* Creates a new matrix (2D array). \*/  
**$Height**; /\* The height of the matrix.e.g. 3 \*/   
**$Width**) /\* The width of the matrix.e.g. 4 \*/ 

### 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](MatrixRelease.md) 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](MatrixWidth.md)"; $matrix ) &amp; " x " &amp; MBS ( "[Matrix.Height](MatrixHeight.md)"; $matrix ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.Release](MatrixRelease.md)"; $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](MatrixSetColumn.md)"; $matrix ; 0;"15¶07¶92" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetColumn](MatrixSetColumn.md)"; $matrix ; 1;"17¶3¶60" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetColumn](MatrixSetColumn.md)"; $matrix ; 2;"15¶1¶87" ) \]  
### See also

- [Matrix.IndexOfFirstValueMatching](MatrixIndexOfFirstValueMatching.md)
- [Matrix.InsertOrUpdateRecords](MatrixInsertOrUpdateRecords.md)
- [Matrix.Lookup](MatrixLookup.md)
- [Matrix.MBS](MatrixMBS.md)
- [Matrix.Release](MatrixRelease.md)
- [Matrix.Rotate](MatrixRotate.md)
- [Matrix.SetColumn](MatrixSetColumn.md)
- [Matrix.SetColumnName](MatrixSetColumnName.md)
- [Matrix.Width](MatrixWidth.md)
- [XL.Sheet.CellWriteMatrix](XLSheetCellWriteMatrix.md)

### Blog Entries

- [MBS FileMaker Plugin 16.2 News](https://www.mbsplugins.de/archive/2026-05-20/MBS_FileMaker_Plugin_162_News/monkeybreadsoftware_blog_filemaker)
- [Introducing Matrix.MBS: Dynamic Function Calls with Matrix Parameters](https://www.mbsplugins.de/archive/2026-05-08/Introducing_MatrixMBS_Dynamic_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 15.3 News](https://www.mbsplugins.de/archive/2025-07-29/MBS_FileMaker_Plugin_153_News/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 14.0](https://www.mbsplugins.de/archive/2024-01-23/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)
- [Data structures in MBS Plugin](https://www.mbsplugins.de/archive/2023-11-27/Data_structures_in_MBS_Plugin/monkeybreadsoftware_blog_filemaker)
- [Matrix functions for FileMaker](https://www.mbsplugins.de/archive/2019-05-28/Matrix_functions_for_FileMaker/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2019, Seite 29 bis 30](https://filemaker-magazin.de/neuigkeit/4053-Appetithappen-FMM_201904)

This function checks for a license.

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

  
[Matrix.Multiply](MatrixMultiply.md) - [Matrix.NewWithSQL](MatrixNewWithSQL.md)

[HTML Version](MatrixNew.shtml)