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

1 次查看(过去 30 天)
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

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by