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.
As TheEmptySet says, there is nothing wrong with its result, you could try declaring x to be positive, but I don't have the symbolic toolboxes so I can't tell you how to do that.
(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).
CB