positive number produced from calculation

1 回表示 (過去 30 日間)
badrul hisham
badrul hisham 2016 年 4 月 9 日
コメント済み: badrul hisham 2016 年 4 月 10 日
hi,i have a calculation that requires the output to be positive value. example: (|0.33-0.42|)=0.9 i tried using abs, but the result is not 0.9. matlab does not recognize the | symbol.im guessing i used abs wrong. can someone please show me how to do this?
  2 件のコメント
Star Strider
Star Strider 2016 年 4 月 9 日
The problem is that:
result = abs(0.33-0.42)
result =
0.09
What leads you to believe the correct result is 0.9?
badrul hisham
badrul hisham 2016 年 4 月 10 日
i've tried your coding and it works. it was just my mistake. i called a different input and used it in the the operation. thank you for your help

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

採用された回答

Kuifeng
Kuifeng 2016 年 4 月 9 日
abs(0.33-0.42)
  1 件のコメント
badrul hisham
badrul hisham 2016 年 4 月 10 日
thank you!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by