E = m*c^2 as Symbolic Equation
조회 수: 8 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
madhan ravi
2020년 9월 12일
Note: Don’t name a variable *lhs and rhs, there exist functions already.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!