How to combine subs and solve correctly?
2 views (last 30 days)
Show older comments
Dear MATLAB-Central,
Trying to solve the intersection of a circle (param. repr. x=C+R*(1-T^2)/(1+T^2); y=D+R*(2*T)/(1+T^2)) and an ellipse ((x-E)^2/A^2 + (y-F)^2/B^2 = 1), with given but varying positions and radii in the variables a,b,c,d,e,f, I do the following:
- syms A B C D E F R t
- Expr = (C+R*(1-(t*t))/(1+(t*t)) - E)*(C+R*(1-(t*t))/(1+(t*t)) - E)/(A*A) + (D+R*2*t/(1+(t*t)) - F)*(D+R*2*t/(1+(t*t)) - F)/(B*B);
- Expr = subs(Expr,{A,B,C,D,E,F,R},{a,b,c,d,e,f,r});
- Expr = simplify(Expr);
- solve(Expr == 1,t)
This code produces the error message: "Conversion to char from logical is not possible."
How can I solve this problem? I greatly appreciate any help suggestion.
Best regards,
Verena
0 Comments
Accepted Answer
Walter Roberson
on 3 Oct 2012
The ability to use "==" in solve() was introduced in R2012a. If you are using an earlier version you will have to change your last line to
solve(Expr - 1, t)
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox 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!