Restart signal from workspace in Simulink
8 次查看(过去 30 天)
显示 更早的评论
Hi Community,
I extracted a signal from some data, so I have a signal and an corresponding time array in my workspace.
For now, I grab them in Simulink as
[time, signal]
array with a "From Workspace" block.
Is there any way to resart this signal/array during my simulation (without state flow)?
I tried using enabled/triggered subsystems, but this just stops/starts the signal from the point where it would be without the subsystem.
I would like to restart the signal from it's first datapoint.
0 个评论
采纳的回答
Fangjun Jiang
2025-3-24
编辑:Fangjun Jiang
2025-3-24
Use an Integrator block and enable its "Reset" inport, which can receive your "reset" or "trigger" signal.
The input to the Integrator block is a Constant value of 1. Once reset or triggered, the Integrator block ouptut value will increase from zero at the same pace as the simulation clock.
Feed this "time/clock" signal to an 1-D Lookup Table block. The table data is your [time, signal] value.
Every time the clock starts from zero and increases, the output of the Lookup Table block will be this restarted signal.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!