create_matrix
Generate symbolic or numeric matrices using a list of lists. Define matrix elements as numbers or expressions, optionally assign a variable name, and store the result for symbolic algebra operations.
Instructions
Creates a SymPy matrix from the provided data.
Args:
matrix_data: A list of lists representing the rows and columns of the matrix.
Each element can be a number or a string expression.
matrix_var_name: Optional name for storing the matrix. If not provided, a
sequential name will be generated.
Example:
# Create a 2x2 matrix with numeric values
matrix_key = create_matrix([[1, 2], [3, 4]], "M")
# Create a matrix with symbolic expressions (assuming x, y are defined)
matrix_key = create_matrix([["x", "y"], ["x*y", "x+y"]])
Returns:
A key for the stored matrix.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
matrix_data | Yes | ||
matrix_var_name | No |
Input Schema (JSON Schema)
{
"properties": {
"matrix_data": {
"items": {
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "string"
}
]
},
"type": "array"
},
"title": "Matrix Data",
"type": "array"
},
"matrix_var_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Matrix Var Name"
}
},
"required": [
"matrix_data"
],
"title": "create_matrixArguments",
"type": "object"
}