フィルターのクリア

Problem with syms and subs continues to display the subbed expressions as variables.

1 回表示 (過去 30 日間)
Everytime I try to run this is just returns the variable isolation. It's not giving me values. I can't figure out what's going wrong? Help!
D1 = 1;
D2 = 40;
D3 = 10;
D4 = 70;
Weight1 = 100;
Weight2 = 0;
AllVariables = [D1 D2 D3 D4 Weight1 Weight2];
syms Pug1 Pug2
Set1 = sym('(D1 + D3) * Pug1 - D3 * Pug2 = Weight1');
Set2 = sym('-D3 * Pug1 + (D2 + D3 + D4) * Pug2 = Weight2');
[Pug1,Pug2] = solve(Set1,Set2)
P_1 = double(subs(Pug1,[sym('D1'),sym('D2'),sym('D3'),sym('D4')],AllVariables))
P_2 = double(subs(Pug2,[sym('D1'),sym('D2'),sym('D3'),sym('D4')],AllVariables))
  1 件のコメント
Stephen23
Stephen23 2017 年 2 月 26 日
@Anas Deiranieh's: this time I formatted your code for you. Next time you can do it yourself by selecting the code text and clicking the {} Code button above the textbox.

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 2 月 26 日
D1 = 1;
D2 = 40;
D3 = 10;
D4 = 70;
Weight1 = 100;
Weight2 = 0;
syms Pug1 Pug2
Set1 = (D1 + D3) * Pug1 - D3 * Pug2 == Weight1;
Set2 = -D3 * Pug1 + (D2 + D3 + D4) * Pug2 == Weight2;
[Pug1,Pug2] = solve(Set1,Set2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by