type parameter to select the specific query, and three individual endpoints — nrows, ncols, and shape. All endpoints accept a single input matrix a and the full set of common request parameters.
Consider the following sample matrix used throughout the examples on this page:
Combined endpoint
Use this endpoint to query any dimension property by setting thetype field.
POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-dimensions
Parameters
number[][]
required
The input matrix, expressed as an array of row arrays.
string
required
The dimension property to compute. Accepted values:
"all"— compute and return all dimension properties"nrows"— number of rows"ncols"— number of columns"shape"— both dimensions as a(rows, cols)tuple
string
default:"ans"
Name assigned to the computed result in the response.
string
default:"detailed"
Response verbosity:
"lite", "standard", or "detailed".boolean
default:"true"
Include background theory alongside solution steps.
string[]
default:"[\"\"]"
Format for step content:
"html", "latex", or "speech".integer | null
default:"null"
Decimal precision for rounding. Pass
null for full precision.boolean
default:"false"
Apply
decimals rounding to intermediate step values.boolean
default:"true"
Include normalized request parameters in the response.
boolean
default:"true"
Include curated learning resource links in the response.
Include links to related Stemfard endpoints in the response.
boolean
default:"true"
Include a description of the result object’s properties.
Example — query all dimension properties
200
Individual dimension endpoints
Each dimension query has its own focused endpoint. These do not accept atype field — the query is determined by the path.
POST .../matrix-dimensions/nrows — number of rows
POST .../matrix-dimensions/nrows — number of rows
Returns the number of rows in the input matrix.Example
POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-dimensions/nrowsnumber[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity:
"lite", "standard", or "detailed".integer | null
default:"null"
Decimal precision for rounding.
200
POST .../matrix-dimensions/ncols — number of columns
POST .../matrix-dimensions/ncols — number of columns
Returns the number of columns in the input matrix.Example
POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-dimensions/ncolsnumber[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity:
"lite", "standard", or "detailed".integer | null
default:"null"
Decimal precision for rounding.
200
POST .../matrix-dimensions/shape — rows and columns
POST .../matrix-dimensions/shape — rows and columns
Returns both dimensions as a ExampleThe response value is an array where the first element is the number of rows and the second element is the number of columns.
(rows, cols) tuple. This is equivalent to querying nrows and ncols in a single request.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-dimensions/shapenumber[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity:
"lite", "standard", or "detailed".integer | null
default:"null"
Decimal precision for rounding.
200