How to get the remainder of a division in Simulink?
109 次查看(过去 30 天)
显示 更早的评论
Hi!
How can I get the remainder of a division in simulink (similar to the rem function of matlab)? thanks, paulo
1 个评论
Suyash Jadhav
2024-7-2
You can use the formula-
Rem= number to divide- floor(Quotient*Divisor)
This can be constructed in simulink.
采纳的回答
Guy Rouleau
2011-5-12
Use the "rem" option of the Math Function block:
@ Paulo Silva: Using the MATLAB Function block for that is like hunting squirrels with a tank... it works, but it's not the most convenient solution.
0 个评论
更多回答(3 个)
Paulo Silva
2011-5-11
in1---->|MUX|---->|Matlab Fcn |--->out
in2---->| | |u(1) - fix(u(1)./u(2)).*u(2)|
or
in1---->|MUX|---->|Matlab Fcn |--->out
in2---->| | |rem(u(1),u(2))|
or even better (found this one now)
Use the Math Function from the Math Operations and choose the rem function!
0 个评论
Arjunkrishna Mitta
2021-8-20
We can also use the math operator and in drop down select the mod operator and you can get the remainder in simulink.
Just click on blank space and type mod you will get the block required
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!