Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MATLAB and Simulink — Matrix Structure Analyzer

A MATLAB toolbox that analyzes the structural properties of a matrix using manual Gaussian elimination (no built-in functions like rank, null, inv, or rref).

Files

File Description
matrixStructureAnalyzer.m Main function that computes all structural properties of a matrix
myRREF.m Computes the Reduced Row Echelon Form (forward + backward elimination)
solveMultipleRHS.m Solves multiple right-hand-side systems (used for one-sided inverses)
demo.m Example usage with a sample matrix
report.docx Detailed technical report (Persian)

Usage

A = [1 2 0 3 5;
     2 4 1 1 5;
     3 6 1 4 5];

res = matrixStructureAnalyzer(A);

disp('Rank(A):'); disp(res.Rank)
disp('Columns independent?'); disp(res.ColumnsIndependent)
disp('Invertible?'); disp(res.Invertible)
disp('Null space basis:'); disp(res.NullSpaceBasis)
disp('Column space basis:'); disp(res.ColumnSpaceBasis)
disp('Left inverse:'); disp(res.LeftInverse)
disp('Right inverse:'); disp(res.RightInverse)

Output Fields

  • Rank (scalar integer) — Number of pivot columns found in RREF
  • ColumnsIndependent (logical) — true when rank == number of columns
  • Invertible (logical) — true only for square matrices with full rank
  • InvertibleReason (string) — Natural-language explanation of why a matrix is or isn't invertible
  • NullSpaceBasis (matrix or string) — Basis vectors for the null space; 'No solution' if null space is trivial
  • NullSpaceDim (integer) — Number of free variables (n - rank)
  • ColumnSpaceBasis (matrix or string) — Pivot columns from the original matrix A
  • ColumnSpaceDim (integer) — Equals rank (by the rank theorem)
  • RowSpaceBasis (matrix or string) — Non-zero rows of the RREF
  • RowSpaceDim (integer) — Equals rank
  • LeftInverse (matrix or string) — Solution to A^T X = I_n (exists only if rank == n)
  • RightInverse (matrix or string) — Solution to A X = I_m (exists only if rank == m)

Algorithm

The entire analysis is built on top of a manual Gauss-Jordan elimination:

  1. myRREF performs forward elimination with partial pivoting, followed by backward elimination to produce the RREF.
  2. solveMultipleRHS performs Gauss-Jordan elimination on the augmented matrix [M | B] to solve M·X = B for multiple right-hand sides simultaneously.
  3. matrixStructureAnalyzer orchestrates the above two functions and extracts all structural properties from the RREF result.

About

Matrix Structure Analyzer

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages