CreateMatrix
The CreateMatrix() function generates a random block of test data.
Syntax:
Qx.CreateMatrix(Rows, Columns, Data Generation Pattern)- In Excel with Quintessence addin versions prior to 25.1, use:
CreateMatrix() - In the Quintessence Editor (Studio) using Quintessence language, use:
CreateMatrix() - In the Quintessence Editor (Studio) using Python language, use:
Qx.CreateMatrix()
ⓘ See parameter descriptions
| Rows | The number of rows to generate. |
| Columns | The number of columns to generate |
| Data Generation Pattern (optional) | Predefined set of rules for creating synthetic or test data in a consistent and repeatable way. |
Remarks:
- Unless changed by an administrator, the default parameters are:
- Data Generation Pattern:
random
- Data Generation Pattern:
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Create a random 2×3 array
This can be achieved by calling the function as follows:
=Qx.CreateMatrix(2, 3)Result: (values will differ because they are randomly generated)
| 256.1369 | 966.224 | 309.7549 |
| 14.31381 | 7.174246 | 917.6893 |
> Example 2: Create a 2×3 array where all values are the same
This can be achieved by calling the function as follows:
=Qx.CreateMatrix(2, 3, "Hello World!")Result:
| Hello World! | Hello World! | Hello World! |
| Hello World! | Hello World! | Hello World! |
> Example 3: Create a 3×3 identity matrix
This can be achieved by calling the function as follows:
=Qx.CreateMatrix(3, 3, "identity")Result:
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
