Restart signal from workspace in Simulink

조회 수: 8 (최근 30일)
Phab
Phab 2025년 3월 24일
댓글: Phab 2025년 3월 25일
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.

채택된 답변

Fangjun Jiang
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.
  댓글 수: 1
Phab
Phab 2025년 3월 25일
Wow, I love these simple answers!
Perfect according to the KISS principle.
And every time I ask myself why I don't think of it myself.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by