How to define an arbitrary constant for equations?

8 ビュー (過去 30 日間)
Yunus Emre ERYILMAZ
Yunus Emre ERYILMAZ 2018 年 3 月 26 日
Hello everyone. I want to define a arbitrary constant for equations that I wrote. How can I define? I tried to define with cond command but it didn't work.
v1=6;
v3=18;
syms v2 v4 v5 v6
eqn1= -v4+v5==-v3;
eqn2= -v2+v6==v3;
eqn3= -v5-v6==-v1;
cond= v6~=0;
[v2 v4 v5 v6]=solve(eqn1, eqn2, eqn3);
[v2 v4 v5 v6]

採用された回答

Birdman
Birdman 2018 年 3 月 26 日
If you are talking about making an assumption, you can do it as follows:
v1=6;
v3=18;
syms v2 v4 v5 v6
eqn1= -v4+v5==-v3;
eqn2= -v2+v6==v3;
eqn3= -v5-v6==-v1;
assume(v6~=0)
[v2 v4 v5 v6]=solve(eqn1, eqn2, eqn3);
[v2 v4 v5 v6]
  1 件のコメント
Yunus Emre ERYILMAZ
Yunus Emre ERYILMAZ 2018 年 3 月 27 日
That's what I want. Thank you very much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParticle & Nuclear Physics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by