define a counter which will starts counting from zero automatically when the count reaches to 10
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello all , can you please explain how to model a simple counter which will continue to count from the start when it reaches its max value to 10.
0 commentaires
Réponses (2)
Chunru
le 16 Nov 2022
c = 0; % initialization
while true
c = mod( c + 1, 10); % count from 0 to 9 then re-start
end
2 commentaires
Andy Bartlett
le 16 Nov 2022
In a Simulink model, click on the canvas and type "counter"
you'll see a list of blocks
one of these is called Counter Limited
it does exactly what you are asking for.
Voir également
Catégories
En savoir plus sur General Applications dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!