フィルターのクリア

positive solutions error when solving eqn

1 回表示 (過去 30 日間)
matlab
matlab 2020 年 6 月 23 日
編集済み: madhan ravi 2020 年 6 月 23 日
Solving for how the error below can be solved:
syms y
x = 0.001;
z = 0.0009;
eqn = y^3 - 3*x*y + 3*z*x == 0
Sol_z = solve(eqn,y,'Real',true)
Sol_z =
9.0024e-04
0.0543
-0.0552
%here I can not get the only positive solutions that I want (i.e. 0.054 and 9.0024e-04)
if (Sol_z > 0)
b = Sol_z
end
"Conversion to logical from sym is not possible."
how can i solve this error and get the only positive solutions using the code above

採用された回答

madhan ravi
madhan ravi 2020 年 6 月 23 日
編集済み: madhan ravi 2020 年 6 月 23 日
Sol_z(double(Sol_z) > 0)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by