How to solve A*X = B*Y
Show older comments
Hello,
I would like to solve the following equation : A*X = B*Y where A and B are n-by-n known matrices. X and Y are vectors of size n. The first k elements of X and the last n-k elements of Y are known. Does anyone have a clue ?
Thank you very much for your help!
Accepted Answer
More Answers (1)
== This is not valid Matlab syntax ==
The first k elements of X are known and the last n-k of Y:
X = [q; x] = [q; 0] + [0; x] % Here "0" means a zero vector
Y = [y; p] = [y; 0] + [0; p]
Now you get:
A*X = A*[q; 0] + A*[0; x] = B*[y; 0] + B*[0; p]
A*[0; x] - B*[y; 0] = B*[0; p] - A*[q; 0] = C
[A(:, 1:k), B(:, k+1:n)] * [y; x] = D * [y; x] = D*z = C
z = D\C;
X_unknown = z(k+1:n);
Y_unknown = z(1:k);
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!