TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

MATLAB rref

MATLAB rref with MATLAB Tutorial, MATLAB, MATLAB Introduction, MATLAB Installation, MATLAB Platform, MATLAB Syntax, MATLAB Data Types, MATLAB Variables, MATLAB Operators, MATLAB Commands, MATLAB Loops, MATLAB Strings, MATLAB Numbers, MATLAB Vectors, MATLAB Downloading etc.

<< Back to MATLAB

MATLAB rref

Reduced Row Echelon Form (rref) takes the Gauss-Jordan elimination method one step further by operating scaling EROs on all rows so that the aii coefficients on the diagonal all become ones.

MATLAB rref

Reduced Row Echelon Form take this one step further to result in all 1's rather than the a', so that the column of b's is the solution:

MATLAB rref

MATLAB has built-in function to do this, known as rref. For example, for the preceding examples:

	>> a = [1 3 0; 2 1 3; 4 2 3];
            >> b = [1 6 3]';
            >> ab = [a b];
           >> rref(ab)
           ans =
		1   0   0   ?2
                        0   1   0     1
                        0   0   1     3

The solutions are found from the last column, so x1 = -2, x2 = 1, and x3 = 3. To get this in the column vector in MATLAB:

MATLAB rref

Finding Matrix Inverse by reducing an Augmented Matrix

For the system of equations larger than a 2x2 system, one method of finding inverse of a matrix A mathematically contains augmenting the matrix with an identity matrix of a similar size and then reducing it.

The algorithm is:

  • Augment the matrix with I: [A I]
  • Reduce it to the method [I X]; X will be A-1.

For example, in MATLAB we can starts with a matrix, augmented it with an identity matrix, and then use the rref functions to reduce it.

>> a = [1 3 0; 2 1 3; 4 2 3];
>> rref([a eye(size(a))])
ans = 
      1.0000      0              0             ?0.2000      ?0.6000       0.6000
           0       1.0000        0               0.4000        0.2000      ?0.2000
          0            0        1.0000                0             0.6667      ?0.3333
In MATLAB, the inv functions can be used to check the result.
>> inv(a)
         ans =
            ?0.2000   ?0.6000      0.6000
              0.4000     0.2000    ?0.2000
                   0          0.6667   ?0.3333





Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf