Arrange linear equation w.r.t variables

3 views (last 30 days)
SMK
SMK on 28 Jan 2013
Hello,
How I can arrange the following linear equations such that it results same equations but with sequence of a,b,c and d?
R =
[0.8978*c - 0.8047*b - 0.020299*a, 0.8978*d - 0.094800*b - 0.106799*a]
[ 0.091199*a + 0.13200*c - 0.8047*d, 0.091199*b - 0.106799*c + 0.0575*d]
Thanks.
  2 Comments
SMK
SMK on 29 Jan 2013
It means that how I can arrange any result w.r.t its variables, so that I can get coefficient matrix in sequence of variables. Might be this time I could explain it.

Sign in to comment.

Answers (1)

Thorsten
Thorsten on 28 Jan 2013
The columns are a, b, c, d and the values in row 1, 2, 3 are the coefficients in your equation 1, 2, 3. Use zero if there is no coefficient, such as for d in your first equation
>> R = [-0.020299 -0.8047 0.8978 0 ; -0.106799 -0.094800 0 0.8978; 0.091199 0 0.13200 -0.8047; 0 0.091199 -0.106799 0.0575]
R =
-0.0203 -0.8047 0.8978 0
-0.1068 -0.0948 0 0.8978
0.0912 0 0.1320 -0.8047
0 0.0912 -0.1068 0.0575
You can then compute a solution to R*[a;b;c;d] = [1;5;30;4] (for example) by
R\[1;5;30;4];
  2 Comments
SMK
SMK on 29 Jan 2013
Thanks, but how we reached on this arranged coefficient matrix?
Thorsten
Thorsten on 29 Jan 2013
Convert each equation of the sort c1*a + c2*b + c3*c + c4*d to a row of your matrix
c1 c2 c3 c4
So for example 0.8978*c - 0.8047*b - 0.020299*a gives values c4 = 0 (because there is no d), c3 = 0.8978 (the coefficient in front of c), c2 = -0.8047 (the coefficient in front of b) and finally c1 = -0.02099 (the coefficient in front of a):
-0.0203 -0.8047 0.8978 0
Same for the other terms you have.

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!