필터 지우기
필터 지우기

output of mod block is not correct

조회 수: 2 (최근 30일)
we.pull
we.pull 2018년 8월 1일
답변: Rachana Reddy Mamilla 2018년 8월 13일
Could someone please explain the following behaviour of mod block. (See image attached) There are two problems here. the output of mod(1,1) is not zero the output of mod(2,1) is a very less positive number.

답변 (1개)

Rachana Reddy Mamilla
Rachana Reddy Mamilla 2018년 8월 13일
Hello, Whenever we do arithmatic operations with the floating point variables there is a small precision error associated which leads to these results.This can be removed by subtracting the eps value and then apply mod. I'm not able to exactly reproduce your case but hope this and this would help you.
You can also look through eps and Math/Algorithms in this link . Hope this helps.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by