![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/358075/image.png)
My Simple model does not run when my time is set to 10 seconds
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a stop time of 10 seconds but it doesn't seem to actually leave the 0 sec position. First time ever using simulink, what am I doing wrong.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/358054/image.jpeg)
0 commentaires
Réponse acceptée
stozaki
le 9 Sep 2020
Hello Jorje,
Probably because the sample time value in your constant block is the default value.
The constant block sample time defaults to inf. The default value of inf indicates that the block output can never change. This setting speeds simulation and generated code by avoiding the need to recompute the block output.
If you want to get the output of the Constant block at each sample time, set the sample time of the Constant block explicitly to the sample time.
In the previous Scope block, the sample time of the Scope block was set to 1 second, so it continuously observed 1.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/358075/image.png)
Regards,
stozaki
4 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!