2008年11月25日星期二

The Interesting Characters of Triggered Subsystem

Maybe sb. is not very familiar with Triggered Subsystem. In fact, there are many interesting characters in Triggered Subsystem.
This is the figure of Triggered Subsystems. One of its useful characters is that it keeps the value of the time when it has been triggered, until it is been triggered the next time. For example:Make the Trigger input of the Triggered Subsystem the Step signal, whose step time has been set to 1s. Thus the Triggered Subsystem would be triggered at 1 second. And the input of the empty Triggered Subsystem is Clock block. It is interesting to guess what is the output.
The answer is that at 1 second, the Triggered Subsystem keeps the value of that time until the simulation ended. As is shown in the below.
This is to say that at the time of simulation, we can use this model to save some value which we are interested in. Also, we can use the command of PERSISTENT to define the persistent variable in m-file to save some value while simulating.

没有评论: