matrix_addition
Add two matrices by providing matching lists of lists; returns the summed matrix or an error if dimensions are incompatible.
Instructions
Adds two matrices.
Args: matrix_a: The first matrix as a list of lists. matrix_b: The second matrix as a list of lists.
Returns: On success: {"result": } On error: {"error": }
Examples: >>> matrix_addition([[1, 2], [3, 4]], [[5, 6], [7, 8]]) {'result': [[6, 8], [10, 12]]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matrix_a | Yes | ||
| matrix_b | Yes |