output of mod block is not correct
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192959/image.jpeg)
1 Commento
Risposte (1)
Rachana Reddy Mamilla
il 13 Ago 2018
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.
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!