Using edge function as a trigger

4 ビュー (過去 30 日間)
Rob Robinson
Rob Robinson 2020 年 8 月 27 日
回答済み: Ayush Gupta 2020 年 9 月 9 日
I have a very basic simulink model. Inside the function block I have the following code based on the information herehttps://uk.mathworks.com/help/physmod/simscape/lang/discrete-event-modeling.html#bu6gpnj-1
function y = fcn(u)
y = edge(u);
The second result plot does not capture the rising edge as I would expect. Would anybody be able to explain what I am doing wrong?

回答 (1 件)

Ayush Gupta
Ayush Gupta 2020 年 9 月 9 日
 The documentation page about discrete event modeling is for Simscape code. It is not MATLAB code and cannot be used in a MATLAB function block. A possible workaround for edge triggering block would be to use the Edge Detector block in Simulink.

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by