Hello,
I have been learning to use Symbolic Equations in MATLAB. I stumbled upon this question of writing Einstein's Mass Energy Equation in MATLAB. I tried the following code.
syms E m c
lhs = E
rhs = m * c^2
EinsteinEquation = lhs == rhs
But the output has been E = c^2 * m.
Why does this occur?
How to display the equation as I want it to be?

 採用された回答

madhan ravi
madhan ravi 2020 年 9 月 12 日

0 投票

Note: Don’t name a variable *lhs and rhs, there exist functions already.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Symbolic Math Toolbox についてさらに検索

製品

リリース

R2020a

タグ

質問済み:

JPS
2020 年 9 月 12 日

回答済み:

2020 年 9 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by