Problem with solve function
1 view (last 30 days)
Show older comments
Hi if I use the solve function it doesnt work, like on my colleagues computer.
Here an example:
>> syms x
>> d=solve(x*5+15,x)
d =
-3
>> d=solve(x*5+15==0,x)
d =
x
somehow I get d=-3 when I let the ==0 out, but this makes no sense to me.
Even when I use the example from the help Page
syms x
eqn = sin(x) == 1;
solx = solve(eqn,x)
my result is solx=x
Has anyone an Idea, what I am doing wrong? Maybe some settings I need to change?
Thank you for your help
0 Comments
Accepted Answer
madhan ravi
on 12 Dec 2018
Edited: madhan ravi
on 12 Dec 2018
Try clear all at the very beginning and run your code , you are overwriting the variable which leads to confusion. FYI I got the correct results using your code without any flaws.
4 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!