MATLAB Programming/More complicated matrix operations
From Wikibooks, the open-content textbooks collection
Contents |
[edit] Row reduced echelon form
To find the Row reduced echelon form of a matrix just use the MATLAB command rref
Example:
a=[1 2 3; 4 5 6]; b=rref(a);
It's that simple. (I believe that MATLAB uses the Gauss-Jordan elimination method to make this computation; don't quote me on that (I'm not even sure if there are other methods)).
[edit] Inverse
To find the inverse of a matrix use the MATLAB command inv. (note the matrix must be square)
Example:
a=[1 2 3;4 5 6;7 8 9]; b=inv(a);
[edit] Coffactor, minor
[edit] The Jacobian
t=jacobian(e,w);
e is a scalar vector, w is a vector of functions. Also, this does not solve equations symbolicaly unless you define the w vector functions as symbolics prior to executing this statment.
Example:
syms x y z; w=[x y z]; e=[1 2 3]; t=jacobian(e,w);