* 采用Monostable模块保持指定的时间长度;
* 在模型中放入一个Triggered Subsystem模块,用于保持这个瞬时信号;
* 在模型中放入一个Matlab function模块,用于将瞬时信号转化成正的标量;
* 用乘法器将Monostable模块的输出和Triggered Subsystem模块的输出相乘即可。

再封装一下,就实现了输入一个脉冲信号,输出一个宽度为1s的幅值为同样大小的方波信号。
舜发于畎亩之中,傅说举于版筑之间,胶鬲举于鱼盐之中,管夷吾举于士,孙叔敖举于海,百里奚举于市。故天将降大任于是人也,必先若其心志,劳其筋骨,饿其体肤,空乏其身,行拂乱其所为,所以动心忍性,增益其所不能 (One can do his best to be greatly successful although he is very common before)

function testHelp
%testHelp tests help
% You can get help from it
% See also TESTHELP.
function testHelp
%testHelp tests help
% You can get help from it
% See also tESTHELP.
function testHelp
%testHelp tests help
% You can get help from it
% See also TESTHELP.
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.

上图就是Triggered模块的内部示意图,通过修改正上方的Trigger,可以指定是上升沿触发,还是下降沿触发,还是either,都触发。
我们以上升沿触发为例,说明它的一个特殊的功效。
* Triggered模块在触发之后,保持了它触发那一瞬间的值。
也就是说,在Triggered模块被触发之后,只要还没有被再次触发,它将一直输出触发那一瞬间的值,比如
我们让触发器为上升沿触发,接入step信号,step time 设定为 1s,那么将在仿真1s时触发Triggered Subsystem,Triggered Subsystem的输入是时间,内部为空,如上图所示,那么输出是什么呢?模块如下图所示
答案是,输出将在1s以后一直保持1,因为step上升的时间是1s,因此Triggered Subsystem保存了这个值,直到被下次触发。结果如下图所示:
也就是说,在仿真的时候,我们可以利用这一特性,保存一些我们需要的值。
关键是我们要认识到触发子系统不被触发的时候保存了输出,而不是将输出恢复到触发前的水平。