How do I control when the downsample Simulink block begins to sample?

조회 수: 2 (최근 30일)
Victor Esparza
Victor Esparza 2022년 5월 24일
편집: Shivang 2023년 10월 16일
I would like to control when the downsample block start sampling. At the moment it starts at sample 0.
I tried to use the Enable block but, that only resets the states within the sub system and the downsample sampling remains unchanged.
Could you provide some advice on this?

답변 (1개)

Shivang
Shivang 2023년 10월 16일
편집: Shivang 2023년 10월 16일
Hi Victor,
I understand you would like to control the instant when the 'Downsample' block starts sampling.
This can be done using the 'Switch' block. The two data inputs to the 'Switch' block would be the original signal and the downsampled signal generated after passing the original signal through a 'Downsample' block.
The control input to the 'Switch' block can come from a 'Relational Operator' block. This block can be used to generate a high signal once the simulation time exceeds a certain threshold. The current simulation time can be obtained using the 'Clock' block and the threshold specified using a 'Constant' block.
With this setup, the original signal will pass through, and the downsampling of the signal will only begin at the specified threshold.
Refer to the image below for a visual representation of the above setup.
Hope this helps.
Regards,
Shivang

카테고리

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

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by