expr2=coll​ect(EXPR,'​exp(-t)') Why is it wrong?

EXPR=str2sym('(x^2+x*exp(-t)+1)*(x+exp(-t))')
expr1=collect(EXPR)
expr2=collect(EXPR,'exp(-t)')
Why expr2 shows: sym.charToFunction (line 26) Invalid variable name

 采纳的回答

expr2=collect(EXPR,exp(-t)) % no single quotes around the second argument

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品

版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by