"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!