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.


Basis for a vector space

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.




linalg::basis(S) returns a basis for the vector space spanned by the vectors in the set or list S.

linalg::basis(S) removes those vectors in S that are linearly dependent on other vectors in S. The result is a basis for the vector space spanned by the vectors in S.

For an ordered basis of vectors, S should be a list of vectors.

The vectors in S must be defined over the same component ring.

The component ring of the vectors in S must be a field, i.e., it must be of category Cat::Field.


Example 1

We define the domain of matrices over :

MatQ := Dom::Matrix(Dom::Rational):

and compute a basis for the vector space spanned by the vectors , and :

v1 := MatQ([3, -2]): 
v2 := MatQ([1, 0]): 
v3 := MatQ([5, -3]):
linalg::basis([v1, v2, v3])

If not a list but a set of vectors is given, then the basis returned may not consist of the same vectors as above. The order of the vectors in the set depends on the internal order (see sysorder and DOM_SET), i.e., the order of the vectors appears to be random:

b := linalg::basis({v1, v2, v3}):
op(b, 1)



A set or list of n-dimensional vectors; a vector is a n×1 or 1 ×n matrix of a domain of category Cat::Matrix

Return Values

Set or a list of vectors, respectively.

See Also

MuPAD Functions

Was this topic helpful?