Info

此问题已关闭。 请重新打开它进行编辑或回答。

syms first then add numbers

2 次查看(过去 30 天)
Philosophaie
Philosophaie 2013-9-17
关闭: MATLAB Answer Bot 2021-8-20
This may sound silly but I would like to write an equation in "syms" variables to actually see the variables in the equation then after it is printed out add numbers to the equation to get the final results. Is this possible?

回答(1 个)

Walter Roberson
Walter Roberson 2013-9-17
syms x y z
eqn = x^3 + sin(y) - exp(z);
pretty(eqn)
val = subs(eqn, {x, y, z}, {7, pi/3, 1/2});
pretty(val)
double(val)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by