I am new to MATLAB and I have a question which looks pretty obvious but I don't quite understand how to do it.
Let's say I have 100 x 100 matrix and it's rank is 50. How can I reduce its dimensions so it will be 50 x 100? That is, how do I eliminate those rows that don't contribute to its rank?
You can use rref to determine which columns in your matrix form the column space, and hence which vectors determine the rank of your matrix. Given your matrix that you're examining A, you would call rref like so:
[R,RB] = rref(A);
R would be your matrix decomposed into row-reduced echelon form while RB denotes the column indices that form the basis of your matrix A. Therefore, to seek what you're asking, you would simply do:
Areduced = A(:,RB);
Areduced will be the matrix that only consists of those basis vectors that form the column space of A and hence reduce your matrix A so that it only consists of those columns that allowed your matrix to be full rank.
However, judging from your question, you want to operate along the rows instead of the columns. Therefore, you can transpose your matrix first, use rref on the result, then transpose back when you're finished:
Atranspose = A.';
[R,RB] = rref(Atranspose);
Areduced = Atranspose(:,RB).';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With