Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

linalg::row

Extract rows of a matrix

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

linalg::row(A, r)
linalg::row(A, r1 .. r2)
linalg::row(A, list)

Description

linalg::row(A, r) extracts the r-th row vector of the matrix A.

linalg::row(A, r1.. r2) returns a list of row vectors whose indices are in the range r1.. r2. If r2< r1 then the empty list [] is returned.

linalg::row(A, list) returns a list of row vectors whose indices are contained in list (in the same order).

Examples

Example 1

We define a matrix over :

A := Dom::Matrix(Dom::Rational)( 
  [[1, 1/5], [-3/2, 5], [2, -3]] 
)

and illustrate the three different input formats for the function linalg::row:

linalg::row(A, 2)

linalg::row(A, [2, 1, 3])

linalg::row(A, 2..3)

Parameters

A

An m×n matrix of a domain of category Cat::Matrix

r

The row index: a positive integer less or equal to m

r1 .. r2

A range of row indices (positive integers less or equal to m)

list

A list of row indices (positive integers less or equal to m)

Return Values

Single row vector or a list of row vectors; a row vector is a 1×n matrix of category Cat::Matrix(R), where R is the component ring of A.

Was this topic helpful?