positive number produced from calculation

조회 수: 2 (최근 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일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by