solve non-homogeneous matrix multiplication

I'm trying to understand how to solve a system of matrixes with variables. My equation looks something like
[1 2 3;4 5 6;7 8 9]*[a;b;c] = [10;11;12]
How can i solve this in matlab, is there a function for this?

Answers (2)

temp = [1 2 3;4 5 6;7 8 9] \ [10;11;12];
a = temp(1); b = temp(2); c = temp(3);
Stephen23
Stephen23 on 1 Jun 2017
Edited: Stephen23 on 1 Jun 2017
>> A = [1 2 3;4 5 6;7 8 9];
>> B = [10;11;12]
>> X = A\B
X =
-4.55556
0.11111
4.77778
and checked:
>> A*X
ans =
10.0000
11.0000
12.0000

Categories

Find more on Linear Algebra in Help Center and File Exchange

Asked:

on 1 Jun 2017

Edited:

on 1 Jun 2017

Community Treasure Hunt

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

Start Hunting!