フィルターのクリア

number format comparison difficulty

1 回表示 (過去 30 日間)
Vanessa
Vanessa 2017 年 7 月 27 日
コメント済み: Stephen23 2017 年 7 月 27 日
Hello everyone!!
Here is my problem. Matlab considers that 3.9438e+04 and 39438 are not the same!! How may I fix this? What conversion should I make?
Thank you, Vanessa
  2 件のコメント
Geoff Hayes
Geoff Hayes 2017 年 7 月 27 日
Vanessa - please clarify what you mean by MATLAB not considering these two numbers to be the same. Are you trying to perform some equality check and that is failing? Or is it that visually they don't appear the same in the command window? (In which case you can format the data using Set Command Window output display format.
Stephen23
Stephen23 2017 年 7 月 27 日
It works for me:
>> 3.9438e+04 == 39438
ans = 1
"Matlab considers that 3.9438e+04 and 39438 are not the same"
Most probably those two variables do not have the same values. Have you tried viewing the numbers at a higher precision, e.g. by changing the format or using sprintf ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by