Solving an Incomplete Matrix such that A*transpose(A) = eye(n)
Show older comments
Hello,
I'd like to write a function that takes in a matrix composed of numbers and variables, and solves for the value of the variables given the relationship A * transpose(A) = eye(n) where eye(n) is an n*n identitiy matrix. I've gotten to the point where I can get a system of equations in matrix form, but I'm having trouble extracting the variables from that system. Any and all help would be greatly appreciated!
syms a b c;
A = [0.2193 0.1864 0.9589; a (-0.0160) (-0.2147);b c (-0.1845)];
B = transpose(A);
C = (A*B);
I = eye(3);
A = C == I;
% Given this relationship, I'd now like to solve for a, b, and c. How can I do this?
Accepted Answer
More Answers (1)
Sai Sri Pathuri
on 30 May 2020
You may add the below line
s = solve(A,[a,b,c]);
The solution can be obtained as
aValue = s.a;
bValue = s.b;
cValue = s.c;
The above command returns empty structure when there is no solution
3 Comments
John D'Errico
on 30 May 2020
Edited: John D'Errico
on 30 May 2020
While the call to solve would certainly be valid under some circumstances...
You should recognize the solve as you have suggested creates effectively a system of 9 equations, in 3 unknowns. As such, solve on the overdetermined problem will ALWAYS fail to find a solution. Worse, since one of those equations is the constant one, where we need to solve
1.0023266 == 1
the solution must always fail, even if it was not overdetermined?
If you suggest using solve, you should point out that it must fail, not that it MAY fail, by the hint that it returns an empty result if there was no solution. This is because someone would likely want to then use solve, and they will certainly be surprised at the result.
Matthew Kolodzik
on 30 May 2020
Matthew Kolodzik
on 31 May 2020
Categories
Find more on Mathematics 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!