Why do I get more real solutions then complex solutions for a equation?
Show older comments
I tried to solve an equation using the MATLAB symbolic toolbox:
syms x;
solve(abs(x+1)+abs(5*x-2)==6,x);
The returned result is
ans=-0.75;
If I only allow real solutions by typing
syms x real
solve(abs(x+1)+abs(5*x-2)==6,x)
I get two real solutions
ans =
7/6
-3/4
Why is MATLAB unable to find the second solution (7/6) when solving the equation for complex x?
4 Comments
Adam
on 26 Sep 2014
I don't know nor have the Symbolic Math Toolbox, but surely even the 0.75 answer that it does return is not a solution to that equation either is it?
Andrew Reibold
on 26 Sep 2014
Edited: Andrew Reibold
on 26 Sep 2014
The solution is -0.75, not .075
I think he just made a typo the first time, he has it in the second solution.
I like this question though, I also am interested in the answer.
Adam
on 26 Sep 2014
Yeah, I thought it might be, it just looked as though it would have been a copy and pasted result!
John D'Errico
on 26 Sep 2014
My answer should resolve your questions, I hope.
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
