Ticker

6/recent/ticker-posts

Row Reduced Echelon Form in MATLAB?

Question:

Find Row Reduced Echelon Form, Null, Row and Column Spaces of the given matrix in MATLAB?

\(\begin{pmatrix} 1 & 2 & 4 & -2 & 3\\ 2 & -1 & 2 & 1 & 1\\ 3 & 1 & 6 & -1 & 4\\ 1 & -3 & -2 & 3 & -2 \end{pmatrix}\)

Answer:

Row Reduced Echelon Form can be obtained by doing row operations without using "rref" built-in command of MATLAB

A = [1 2 4 -2 3;2 -1 2 1 1;3 1 6 -1 4;1 -3 -2 3 -2];
% Row Reduced Echelon Form
RREF = rref(A)
% Null Space
nullsp = null(rref(A),'r')
% Row Space
rowsp = RREF(any(RREF,2),:)'
% Column Space
colsp = rank(A)

OUTPUT

RREF =

    1.0000         0    1.6000         0    1.0000
         0    1.0000    1.2000   -1.0000    1.0000
         0         0         0         0         0
         0         0         0         0         0


nullsp =

   -1.6000         0   -1.0000
   -1.2000    1.0000   -1.0000
    1.0000         0         0
         0    1.0000         0
         0         0    1.0000


rowsp =

    1.0000         0
         0    1.0000
    1.6000    1.2000
         0   -1.0000
    1.0000    1.0000


colsp =

     2

Post a Comment

0 Comments