You cannot limit the size of a matrix to a fixed number of elements. However, when you set the default values of a matrix control, you can set the default size.
Do not make the default size of a matrix larger than necessary. If you set a large default size for a matrix, the default data for each element of the matrix saves with the VI and increases the size of the VI on disk.
When you add a matrix control to the front panel, the control initially represents an empty matrix. Each dimension is 0, and the matrix elements are dimmed. A front panel matrix control has two default values—a matrix default value, either a floating-point or complex default value, and a default value in each cell.
The matrix default value is like the default value of any other front panel control. It is the value of the matrix when the VI is loaded. It also is used for a matrix in a subVI when the calling VI does not wire a value.
The scalar default value is the value used to pad the matrix when the matrix expands. For example, if you set the matrix index to a value beyond the defined portion of the matrix and enter a value in an element greater than one row past the defined portion of the matrix, the elements between the previous end of the matrix and the element you added are set to the scalar default.