Declare equality in Symbolic Math Toolbox

6 ビュー (過去 30 日間)
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2013 年 2 月 9 日
I am wondering how to declare an equality in Symbolic Math Toolbox. For example I want to declare that:
z=x1+y1=x2+y2;
How can I do that? Thank you.

回答 (1 件)

José-Luis
José-Luis 2013 年 2 月 9 日
編集済み: José-Luis 2013 年 2 月 9 日
You could do like this:
syms z x1 x2 x3 x4
eqs = [-z+x1+x2; -z+x3+x4; x1+x2-x3-x4];
solve(eqs)
But it is rather pointless as there are an infinite number of solutions (three equations and five unknowns), just pick three of the values (not any three though) and you can calculate the other two.

カテゴリ

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