"Error using symengine Unable to convert expression into double array" when using solve function
Afficher commentaires plus anciens
Hi,
I'm trying to set up a symbolic solver to help solve an equation I can't solve analytically. I need the output of the code in a usable format (double) so that I can use it in another equation. However, when I attempt to run the code, it throws the following error:
Error using symengine
Unable to convert expression into double array.
Error in sym/double (line 698)
Xstr = mupadmex('symobj::double', S.s, 0);
Error in script (line 8)
f_x(counter) = double(solve(eqn, x));
Does anyone have ideas for how to remedy this?
Code for reference:
%% Constants
g = 1.2; y = 0.1; counterlim = 50
while counter < counterlim
syms x
eqn = y == c * sqrt((x ^ (2 / g) - x ^ ((g + 1) / g)));
f_x(counter) = double(solve(eqn, x));
c = c + 0.01
counter = counter + 1;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!