Replacing segmented equations within equation with variables
1 回表示 (過去 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!