PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Mathematics and Algorithms
>
Matrices and Linear Algebra
>
Linear Systems
>
MatrixRank
>
Mathematica
>
Mathematics and Algorithms
>
Graphs & Networks
>
Graph Programming
>
Matrices and Linear Algebra
>
Linear Systems
>
MatrixRank
>
Mathematica
>
Visualization and Graphics
>
Graphs & Networks
>
Graph Programming
>
Matrices and Linear Algebra
>
Linear Systems
>
MatrixRank
>
BUILT-IN MATHEMATICA SYMBOL
Solving Linear Systems
Tutorials »
|
NullSpace
Det
Eigensystem
RowReduce
SingularValueList
Inverse
See Also »
|
Linear Systems
Matrices and Linear Algebra
New in 8.0: Mathematics & Algorithms
More About »
MatrixRank
MatrixRank
[
m
]
gives the rank of the matrix
m
.
MORE INFORMATION
MatrixRank
works on both numerical and symbolic matrices.
The rank of a matrix is the number of linearly independent rows or columns.
MatrixRank
[
m
,
Modulus
->
n
]
finds the rank for integer matrices modulo
n
.
MatrixRank
[
m
,
ZeroTest
->
test
]
evaluates
to determine whether matrix elements are zero. The default setting is
ZeroTest
->
Automatic
.
MatrixRank
[
m
,
Tolerance
->
t
]
gives the minimum rank with each element in a numerical matrix assumed to be correct only to within tolerance
t
.
MatrixRank
works with sparse arrays.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Find the number of linearly independent rows:
Find the number of linearly independent rows:
In[1]:=
Out[1]=
Scope
(5)
MatrixRank
can handle rectangular matrices:
MatrixRank
assumes all symbols to be independent:
MatrixRank
for a machine-number matrix:
Find the matrix rank for a complex-valued matrix:
Find the rank of a sparse matrix:
Options
(2)
The rank of a matrix depends on the modulus used:
With ordinary arithmetic,
m
has the full rank of 3:
With arithmetic modulo 5, the rank is only 2:
The setting of
Tolerance
can affect the estimated rank for numerical ill-conditioned matrices:
In exact arithmetic,
has full rank:
With machine arithmetic, the default is to consider elements that are too small as zero:
With zero tolerance, even small terms may be taken into account:
With a tolerance greater than the pivot in the middle row, the last two rows are considered zero:
Applications
(2)
Most but not all random 10×10 0-1 matrices have full rank:
Estimate the average rank of a random 10×10 0-1 matrix:
Find the ranks of coprimality arrays:
Properties & Relations
(4)
MatrixRank
[
m
]
is equal to
Length
[
SingularValueList
[
m
]]
:
MatrixRank
[
m
]
plus the dimension of the null space is equal to the number of columns of
m
:
The column and row rank of a matrix are equal:
The outer product of vectors has matrix rank 1:
Possible Issues
(1)
MatrixRank
may depend on the precision of the given matrix:
Use exact arithmetic to compute the matrix rank exactly:
Use machine arithmetic. Machine numbers cannot distinguish between
and
:
Use 24-digit-precision arithmetic:
SEE ALSO
NullSpace
Det
Eigensystem
RowReduce
SingularValueList
Inverse
TUTORIALS
Solving Linear Systems
MORE ABOUT
Linear Systems
Matrices and Linear Algebra
New in 8.0: Mathematics & Algorithms
RELATED LINKS
Implementation notes: Numerical and Related Functions
Implementation notes: Algebra and Calculus
New in 5 | Last modified in 6