How do I get an Expression to Use the Value of a Variable that was Assigned after the Expression was Defined?
1 次查看(过去 30 天)
显示 更早的评论
Suppose I assign to a sym as follows:
syms z f g
Define f in terms of z
f = 2*z
Now assign a value to z
z = sym(2)*1i;
But f is still expressed in terms of z and it doesn't seem to substitute the value for z
f
simplify(f)
simplify(f - sym(2)*1i)
But assigning to a new expression in terms of z works as expected.
g = 2*z
How do I get the SMT to realize that f = 2i?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!