Replacing segmented equations within equation with variables
조회 수: 20 (최근 30일)
이전 댓글 표시
I have a really long and stupid equation and I need to factor out a fraction of variables. For example x/y=z, and my function is filled with x and y variables, but I want to replace them with z while keeping the relationship x/y true. Is there a MATLAB function for this purpose or am I condemned to handwriting it?
댓글 수: 0
답변 (1개)
John D'Errico
2023년 8월 30일
편집: John D'Errico
2023년 8월 30일
Literally trivial. For example...
syms x y z
EQ = y/x + sin(x^2/y^2)
simplify(subs(EQ,x,y*z))
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!