Matrix subtract

matrix-subtract · version 1.0.0 · Vectors & matrices · free, no key needed

Subtract two equal-shape finite-number matrices elementwise (a minus b).

Use when you need to: matrix subtraction · elementwise matrix difference.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "a": [
    [
      5,
      6
    ],
    [
      7,
      8
    ]
  ],
  "b": [
    [
      1,
      2
    ],
    [
      3,
      4
    ]
  ]
}

Response:

{
  "result": {
    "result": [
      [
        4,
        4
      ],
      [
        4,
        4
      ]
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "matrix-subtract",
  "version": "1.0.0",
  "input": {
    "a": [
      [
        5,
        6
      ],
      [
        7,
        8
      ]
    ],
    "b": [
      [
        1,
        2
      ],
      [
        3,
        4
      ]
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/matrix-subtract/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"a":[[5,6],[7,8]],"b":[[1,2],[3,4]]}'

The machine-readable contract is at /v1/tools/matrix-subtract/versions/1.0.0.

CLI

node cli.mjs run matrix-subtract 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.