Every time I type "syms x; sqrt(x^2)" in Matlab, it keeps spitting out "ans = (x^2)^(1/2)" instead of x. Even when I tried to type "simplify(sqrt(x^2))", it will still spit out the same answer. How do I fix this? It keeps screwing up an M-file I'm trying to write.
(you should be able to declare the domain of x, you can in Maple and the symbolic toolbox is just a front end to the Maple kernel).