Solving for unknown matrix?
47 次查看(过去 30 天)
显示 更早的评论
I have three known matrices, and one unknown matrix that I need to solve for. The matrices are defined in the code below. The equation to find phi is G = C*phi*B. How do I solve for phi? I tried doing phi = inv(C)*G*inv(B) but C and B are not square matrices.
syms t
G = [10*exp(-t) 3*exp(-t); 0 exp(-2*t)*cos(3*t)+2/3*exp(-2*t)*sin(3*t)];
C = [13 4 1; 1 1 0];
B = [1 0; -1 1; 1 -1];
0 个评论
回答(3 个)
David Goodmanson
2017-10-26
Hi Andrew,
I understand that you are looking for a symbolic solution, but if G were a matrix of numbers, then
phi = C\G/B
is the fastest way to find a phi that works. For your matrix dimensions, phi always has four nonzero elements, but they are not necessarily in the upper left corner of the 3x3.
As Walter has mentioned, the solution for psi is far from unique. For more solutions,
nullC = null(C)
nullBtt = null(B.').'
c1 = rand(1,3); % c1 is 1x3 vector of arbitrary constants; rand here for demo
c2 = rand(3,1); % c2 is 3x1 vector of arbitrary constants; rand here for demo
arb1 = nullC*c1;
arb2 = c2*nullBtt;
phi_new = phi + arb1 + arb2 % another solution
0 个评论
Walter Roberson
2017-10-16
phi = sym('phi', [3 3]);
one_solution = solve(G == C*phi*B, phi(1:2,1:2));
Now one_solution.phi1_1, .phi1_2, .phi2_1, and .phi2_2 give definitions for the top left corner of phi in terms of the other entries of phi . That is, the system is underdetermined and there are an infinite number of solutions.
0 个评论
Zahid Ullah
2022-12-17
2 个评论
DGM
2022-12-17
% Ax + B = R
A = [5 -2; 3 -2];
B = [3 5; 4 -1];
R = [7 0; 4 -8];
% solve for x
x = A\(R-B)
% back-calculate R, check
R2 = A*x + B
John D'Errico
2022-12-17
@Zahid Ullah please don't post questions as an anser to a completely different question. Learn to ask a question, not post an answer.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!