How can you Convert Sym to Double when the sym has already been numerically solved?
Show older comments
I am attempting to create an array of values using symbolic variables, solve for a specific variable, input the rest of the unknowns, then convert the symbolic variable previously solved for back to a double. In attempting to do this, I recieved the following warning:
In Fixed_Number_GA_Codes (line 122)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
This is totally acceptable to have the numeric solution, but in the workspace the array I'm working with remains in symbolic form. Attempting to use sym2poly again on the numeric solutions converts them back to fraction form, and they remain symbolic. Is there any way to make this array a standard double with numeric values after already numerically solving the values? For reference, the code is pasted below:
E_p=2*atan(sqrt((1-Earth(6))/(1+Earth(6)))*tan(theta_p/2))
kepler_p=(t*sqrt(Sun(1)/((Earth(4))^3)))==E_p-(Earth(6)*sin(E_p))
for i=1:100
kepler_p_t(i)=subs(kepler_p,t,t_vals(i));
theta_p_t(i)=solve(kepler_p_t(i),theta_p);
Where the Earth and Sun arrays provide numeric values, and the only symbolic variable is theta_p, which is what is is being solved for after substituting in numeric t_vals.
Accepted Answer
More Answers (0)
Categories
Find more on Number Theory 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!