Recovering row reduced matrix given known column information

30 views (last 30 days)
I'm not the best at MATLAB but to try to learn further, I tried to see if I could recover the matrix A given the RREF form U and information regarding columns a1 and a2. I successfully formed matrix A including columns a1 and a2 while leaving columns a3 and a4 as unknown variables, but using and equivalent expression to equate U and rref(A) yields an incorrect answer. What am I doing incorrectly here?
Interestingly, when isolating rref(A) I noticed that entry a(3,3) is 1. I find this intriguing since I'm not sure how MATLAB can assemble column a3 at all. An explanation as to why MATLAB (seemingly) assumes column a3 would be super helpful.
Code is pasted below...
%%currently doesn't work...
syms A
A = sym('A%d%d', [3 4])
A = 
A(:,1) = [2,-1,1]; A(:,2) = [-2,-3,-1]
A = 
U = sym([1, 0, 4, 1; 0, 1, 1, 2; 0, 0, 0, 0])
U = 
rref(A) == U
ans = 

Answers (1)

MULI
MULI on 28 Mar 2024 at 13:32
Edited: MULI on 28 Mar 2024 at 13:33
Hi Zad,
I understand that you are trying to reconstruct the original matrix from its reduced row echelon form.
When you are directly equating rref(A) to U it does not automatically solve the unknowns in A. The rref function simplifies A to facilitate the solving of linear systems. However it does not work the other way around i.e., it cannot be used to reconstruct unknown elements in A from U.
The symbolic equations from rref(A) == U set conditions for the unknowns but solving these may be complex and does not always lead to a unique solution.
The reason behind the entry a(3,3) being 1 in rref(A) is that the row operations in rref rules naturally led to this result but not because of MATLAB assumption.
Please refer to the following documentation for more information on “rref function and examples related to it.
  1 Comment
Zad
Zad on 28 Mar 2024 at 14:48
I see, in that case how might I go about reversing RREF with the given information in Matlab? Would I simply write the expression that relates the u columns to each other and then plug the a values in as one would do by hand? I was kind of hoping there would be a more elegant method...
Re- a(3,3) being 1, I see that RREF rules naturally lead here, thank you for the explanation.

Sign in to comment.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!