# MATLAB solve a single equation

I am trying to solve this equation: $e^x=x^e+e$ in MATLAB, but I continually get an error. I do not know where to go from here. Any help is appreciated This is what I have:

a = x^exp(1) + exp(1) == exp(x);
syms x
b = solve(a,x);
disp(b);

• Initialise x before using it. – David Apr 27 '16 at 22:49

You need to tell Matlab that $x$ is symbolic before you use it. Swap your first and second lines.
• Have you defined a variable called exp? Clear the workspace and run your code again. – David Apr 28 '16 at 1:02