Can Matlab row reduce this matrix?

조회 수: 15 (최근 30일)
Harel Harel Shattenstein
Harel Harel Shattenstein 2018년 1월 9일
댓글: Alexander Guillen 2018년 3월 2일
Can we row reduce the following matrix?
  댓글 수: 4
Harel Harel Shattenstein
Harel Harel Shattenstein 2018년 1월 9일
It is not homework, I just do not know how to use x,y,z,w in matlab
Alexander Guillen
Alexander Guillen 2018년 3월 2일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

John D'Errico
John D'Errico 2018년 1월 11일
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.

Torsten
Torsten 2018년 1월 9일
https://de.mathworks.com/help/symbolic/rref.html
Best wishes
Torsten.
  댓글 수: 2
Harel Harel Shattenstein
Harel Harel Shattenstein 2018년 1월 9일
Entered
rref([2 -3 3 2 x;-2 3 -1 -1 y;0 3 1 2 z; 2 3 3 5 w])
% code
end
and got
[ 1, 0, 0, 1, 0]
[ 0, 1, 0, 1/2, 0]
[ 0, 0, 1, 1/2, 0]
[ 0, 0, 0, 0, 1]
% code
end
Where are the variables?
Torsten
Torsten 2018년 1월 10일
편집: Torsten 2018년 1월 10일
https://stackoverflow.com/questions/14449255/reduced-row-echelon-of-a-matrix-containing-unknown-constants-in-matlab
Additionally, you may want to check this link:
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by