"Error using symengine Unable to convert expression into double array" when using solve function
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Conversion Between Symbolic and Numeric 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!