Why does the SUBS command change the size of the expression incorrectly?
2 次查看(过去 30 天)
显示 更早的评论
Why does SUBS change the size of the expression even when the variable which would change the size of the expression is not present? For example
syms a b c d e
f = sym('f', [2,2])
g = a + b;
subs(g, {a,b,c}, {d,e,f})
Clearly the result should be a 1x1 sym, not a 2x2?
1 个评论
Paul
2022-2-10
At the risk of stating the obvious, it appears that the expansion of g is determined by the fact that f is in the set of replacement variables, regardless of whether or not f is actually substituted into g. The doc is silent as far as I can tell on what the behavior should be when a variable to be substituted, in this case e, does not appear in the expression.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!