I have a symbolic function exp(a+b), and would like to factor out A=exp(a) to produce exp(a+b) = A*exp(b), but I cannot figure out how to do this in MATLAB. Below is my attempt:
syms a b A
X = exp(a+b);
Y = subs(X,exp(a),A) % = A*exp(b)
however, Y = exp(a+b). For some reason, MATLAB cannot determine: exp(a+b) = exp(a) * exp(b) = A*exp(b).
Any help is greatly appreciated.