Sample time control in S functions

Hi,
I’d like to control the sample time of output so that this output under some conditions comes out only once. Now there are many same outputs.
Is “IsSampleHit” for this purpose?
I got an error if I use this line:
if block.InputPort(1).IsSampleHit
‘IsSampleHit’ cannot be called for a port that has no sample time.
Are there any conditions that must be fullfilled to use ‘IsSampleHit’?
Thanks Senmeis

 采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-10-16

0 个投票

I think you need to have specified a port-based sample time for that input. Also, here is the documentation for IsSampleHit.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simulink 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by