MATLAB Answers

Warning: Explicit solution could not be found.

11 views (last 30 days)
Gun
Gun on 9 Mar 2011
Edited: David on 21 Oct 2013
Sorry for disturbing you guys but i have wrote a code shown below:
upsilon=acos(x2a/6.85)
x3=47.5+5.35*cos(upsilon)
y3=5.35*sin(upsilon)
f4=(x4-x3)^2
f5=-sqrt(5.34^2-x4^2)
f6=(f5-y3)^2
x4main=f4+f6-46.7^2
solve(x4main)
y4=-sqrt(5.34^2-x4main^2)
The problem is when the warning appears saying that explicit solution could not be found.What is wrong with it?
Thanks.

Answers (2)

Andrew Newell
Andrew Newell on 9 Mar 2011
Are you using the Symbolic Toolbox? I don't get any such warning. Maybe some of your variables already have an earlier definition? Try adding
clear
syms x1 x2 x3 x4 x2a
before the above commands.

David
David on 21 Oct 2013
Edited: David on 21 Oct 2013
This is what you need to do, I think.
syms x2a x3 y3 x4 y4
upsilon=acos(x2a/6.85)
x3=47.5+5.35*cos(upsilon)
y3=5.35*sin(upsilon)
f4=sym((x4-x3)^2)
f5=sym(-sqrt(5.34^2-x4^2))
f6=sym((f5-y3)^2)
x4main=sym(f4+f6-46.7^2)
solve(x4main)
y4=-sqrt(5.34^2-x4main^2)
sym() constructs symbolic objects from the input you give it and solve() requires that the equations you give it are symbolic expressions.
Note: You may not need to put sym() around the equations for f4, f5, and f6, but you definitely do for x4main.
David

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!