Can Matlab row reduce this matrix?
6 views (last 30 days)
Show older comments
Can we row reduce the following matrix?
4 Comments
Alexander Guillen
on 2 Mar 2018
Wow, people here so f rude.English is not my first language and I can understand what this person is looking for. I am not sure if this a professional website you can ask questions. It looks like there are just over entitled, self absorbed computer geniuses. As.holes.
Answers (2)
John D'Errico
on 11 Jan 2018
I'm not positive what you are looking for.
Make x,y,z,w symbolic variables.
syms x y z w
Now, construct your array, and do row operations on that array.
What you are not saying is what is the purpose of this task? Thus, given the array:
A = [2 -3 3 2;-2 3 -1 -1;0 3 1 2; 2 3 3 5]
A =
2 -3 3 2
-2 3 -1 -1
0 3 1 2
2 3 3 5
Then this does row reduce the combined matrix.
rref([A,[x;y;z;w]])
ans =
[ 1, 0, 0, 1, 0]
[ 0, 1, 0, 1/2, 0]
[ 0, 0, 1, 1/2, 0]
[ 0, 0, 0, 0, 1]
A clearly has rank 3. We can see that from the above computation, that there is some vector that does not lie in the row space of A. Of course, rref does not give you the linear combination of the rows that yielded that 1 in the bottom right corner. I think perhaps that is what you are looking to find. You wanted that last column to remain expressed as symbolic variables.
So, can we recover the row operations that were applied to A? A and rref(A) occupy the same row space. And while rref =does not return the actual row operations, they can be recovered.
format rat
K = rref(A)*pinv(A)
K =
-1/2 -2/3 -1/6 1/3
-1/6 -1/36 1/18 5/36
1/2 5/12 1/6 -1/12
0 0 0 0
K*A
ans =
1 * * 1
* 1 * 1/2
* * 1 1/2
0 0 0 0
The * elements are all essentially zeros, just tiny trash. As you can see, the result is essentially the same row operations that were applied to A to get rref(A).
We can now apply those same row operations to [x;y;z;w].
K*[x;y;z;w]
ans =
w/3 - x/2 - (2*y)/3 - z/6
(5*w)/36 - x/6 - y/36 + z/18
x/2 - w/12 + (5*y)/12 + z/6
0
But remember that K has rank 3, reflecting the rank of A. We can find a row that is not representable as a linear combination of the rows of A.
null(A,'r')'
ans =
-1 -1/2 -1/2 1
null(A,'r')'*[x;y;z;w]
ans =
w - x - y/2 - z/2
And I still have no idea exactly what you want.
0 Comments
Torsten
on 9 Jan 2018
https://de.mathworks.com/help/symbolic/rref.html
Best wishes
Torsten.
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!