MATLAB: Matlab simplify boolean expression

boolean simplify algebraic

I want to simplify a boolean algebra expression. I have taken this example from matlab online help but it does not work:
simplify((a and b) or (a and (not b)), logic)
Any suggestion?
I am using matlab R2012a (7.14.0.739)

Best Answer

You have copied a MuPAD command. Did you use it inside a MuPAD Notebook? If not, type this at the MATLAB command prompt:
mupad
This will open a MuPAD Notebook. There, paste the input near the bracket (red text should appear) and press enter:
[ simplify((a and b) or (a and (not b)), logic)
a
If you don't want to open a MuPAD notebook, try this in MATLAB:
evalin(symengine, 'simplify((a and b) or (a and (not b)), logic)')
Though if you prefer to stay in MATLAB, you should take what Geoff suggests:
syms a b;
simplify((a & b) | (a & ~b))
(For some reason it did not work for me with the comma between a and b).