Arrange linear equation w.r.t variables

2 ビュー (過去 30 日間)
SMK
SMK 2013 年 1 月 28 日
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 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 1 月 28 日
What does that mean?
SMK
SMK 2013 年 1 月 29 日
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.

サインインしてコメントする。

回答 (1 件)

Thorsten
Thorsten 2013 年 1 月 28 日
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 件のコメント
SMK
SMK 2013 年 1 月 29 日
Thanks, but how we reached on this arranged coefficient matrix?
Thorsten
Thorsten 2013 年 1 月 29 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by