I have a problem with the output of solve
Show older comments
ello,
I tried to solve an equation
syms x y;
S = solve('x^2 + y^2 = 240^2','x*(s-x)+y*(t-y)-240*sqrt((s-x)^2+(t-y)^2)*0.64279=0')
in this case I get
Warning: Warning, solutions may have been lost
S =
x: [4x1 sym]
y: [4x1 sym]
S.x en S.y contains a very long equation that I can not directly convert to a number, but by pasting it in the command window I can find the values
the strange thing is if I replace s en t by their values I get other solutions
syms x y;
S = solve('x^2 + y^2 = 240^2','x*(279.8-x)+y*(-528.05 -y)-240*sqrt((279.8-x)^2+(-528.05 -y)^2)*0.64279=0')
and these are the correct solutions,
x=double(S.x)
y=double(S.y)
x =
-17.428
207.85
y =
-239.37
-120
so why do I get other solutions if I use s and t as a variable? and even stranger, if I replace 0.64279 by the cosinus of an angle than it thus work at all?
any ideas? probaly I am making a mistake somewhere? So wy is my solutions S.x and S.y not available as a number but as an expression, and how can I convert it?
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!