MATLAB: Expr2=coll​ect(EXPR,’​exp(-t)’) Why is it wrong

MATLABr2018bsymbolicSymbolic Math Toolbox

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

Best Answer

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