Unintended Sample Time in Simulink
2 views (last 30 days)
Show older comments
Sreejith Mana on 15 Sep 2022
Commented: Sreejith Mana on 7 Oct 2022
Some of the blocks in simulink don't seem to inherit the global sample time set by Configuration Parameters -> Solver -> Fixed-step size.
Please see the below picture. Can somebody let me know how to change the sample time of these blocks in Green to match with the red?
Also, as seen in the screenshot, many a times, the legends on the right hand side don't show the colour coding. Please let me know how to fix that too.
Thanks in advance.
Harshit Gupta on 6 Oct 2022
As per my understanding, you want to know why some of the blocks in Simulink don’t seem to inherit the Global Sample Time set by Configuration Parameters -> Solver -> Fixed-step size.
This is because some of the blocks in Simulink have an implicit sample time. You cannot specify implicit sample times. Simulink determines them based on the context of the block in the system. This means that different blocks might get different sample times based on their context in the system.
The Sample Time parameter is not available (cannot be set) for certain blocks because specifying a sample time that is not -1 on blocks such as the Gain, Sum, and n-D Lookup Table causes sample rate transition to be implicitly mixed with block algorithms. This mixing can often lead to ambiguity and confusion in Simulink models.
Please refer to the following documentation links for more information on how sample times work in Simulink:
Sreejith Mana on 6 Oct 2022
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!