필터 지우기
필터 지우기

How can I rearrange equations to general form?

조회 수: 4 (최근 30일)
Joona Luume
Joona Luume 2023년 3월 29일
댓글: Joona Luume 2023년 3월 29일
I have simplifyed example of my problem:
syms x y z
eqn1=x+y+5==-z
Matlab gives me answer (as it should)
eqn1=x+y+5==-z
But is there a command to rearrange the equation to either
eqn1=x+y+z+5=0
or
eqn1=x+y+z=-5
Thank you for your help.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 3월 29일
Return all equivalent results with higher number of simplication steps
syms x y z
eqn1=x+y+5==-z
eqn1 = 
out=simplify(eqn1,'All',true,'Steps',4)
out = 
  댓글 수: 1
Joona Luume
Joona Luume 2023년 3월 29일
This is what I was looking for, big thanks to you!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

John D'Errico
John D'Errico 2023년 3월 29일
syms x y z
eqn1=x+y+5==-z
eqn1 = 
Nothing stops you from doing it yourself. For example, I might do:
eqn1 = eqn1 + z
eqn1 = 
Or, you can even use isolate.
eqn1 = isolate(eqn1,x+y+z)
eqn1 = 
Personally, I never understand these questions, though we see them often. :) All that has changed is where a term falls. It is still the same equation. A rose by any other name...
  댓글 수: 1
Joona Luume
Joona Luume 2023년 3월 29일
Firstly, thank you for quick respond.
I understand your point, and my example is bad, but the equations that I need to compute have often more variables and are more complicated. So solving them by hand can be a quite tedious process.
Another example:
syms a b c d e
eqn2=-12*a/34+b*24+c/12==d*23-12*e/5+345
I know I can solve this manually by doing just like you suggested:
eqn3=eqn2-23*d+(12*e)/5
And it gives the answer I need but I was just wondering if there was a simple command to automate this process for me.
Big thanks to you bothering to answer my silly questions :), really appreciate the help!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by