How can I recognize symbolic value with actual value 0?
2 ビュー (過去 30 日間)
古いコメントを表示
I was making some calculation and got symbolic value of
ans =
3/2 - (73^(1/2)/4 - 7/4)*(73^(1/2)/4 + 7/4)
it was actually 0, but matlab didn't recognize it. I used double(syms), but the result was
ans =
-4.5278e-72
how can I make matlab recognize it as 0?
0 件のコメント
採用された回答
その他の回答 (1 件)
Paresh yeole
2020 年 5 月 3 日
You need to specify custom tolerance.
if abs(ans) < 1e-10
ans = 0;
end
You can specify your own tolerance instead of 1e-10.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!