- Take the block "Counter Free-Running" (probably you are using that one or the "Counter Limited) and scale the output by a following "Gain"-Block. For this approach, the sampling time of the counters and maximum values have to be defined as well as the scaling factor.
- Use the "Ramp"-Block with variable slope followed by a "Quantizer"-Block. The values "Quantization interval" can be adjusted as well as "Sample time" (if needed).
How to implement a counter in simulink to increment in defined number of step size
조회 수: 74 (최근 30일)
이전 댓글 표시
Dear All, I would like to implement a counter in simulink to be able to increment witha defined step size as variable. Currently the counter increment in a step of ONE. I would like to increment in step of 2 or 3 or so on based on input. Kindly guide me if any of you have implemented before or applied this logic with available blockset in simulink before. Please do the needful.
댓글 수: 0
답변 (1개)
Robert U
2017년 9월 15일
Hi Shwetha Mangalore,
from what I understand there are several ways to achieve what you desire. I try to sketch you two ways:
If you want to implement a variable slope of the counter depending on a time dependent input, you could build up a "simple" integrator.
Kind regards,
Robert
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!