MATLAB: Does the SUBS command in Symbolic Math Toolbox 5.1 (R2008b) return an error when used to substitute variable ‘D’

backwardbetacicompatibledsolveeeigammaiopsisiSymbolic Math Toolboxthetazeta

When I execute the following:
subs('A+D','D',3)
I receive the error, ERROR: ??? Error using ==> mupadfeval at 28 Error: Illegal operand [subs]; during evaluation of 'mlsubs' Error in ==> sym.subs at 219 G = sym(mupadfeval('mlsubs', charcmd(G), [x '=' charcmd(y)])); Error in ==> sym.subs at 237 G = subs(F,Y,X,0); Error in ==> subs at 60 r = subs(sym(f),varargin{:});
This only seems to occur when the second argument of the SUBS function is the string representation of variable 'D'. This command worked perfectly in the previous version of the Symbolic Math Toolbox (R2008a)

Best Answer

The symbol 'D' is a reserved keyword in the MuPAD engine and is used to specify the differentiation operator. This and other such keywords cannot be used in string representations of expressions in the Symbolic Math Toolbox 5.1 (R2008b). More information about this can be found at the following link: 
You can work around this by using a symbolic variable instead. For example,
syms A D
subs(A + D, D, 3)