Use Simulation Time of Simulink in Matlab function when threshold is exceeded

7 ビュー (過去 30 日間)
Thomas Schütz
Thomas Schütz 2020 年 10 月 20 日
回答済み: Fangjun Jiang 2020 年 10 月 20 日
Hello everybody,
I am currently having a problem with a matlab function which I want to implement in my Simulink Project. In this Matlab function, I want to create some sort of pulse train. Here, the incoming signal has to be compared to a threshold value (here 10000) at a specific time (here 1.7µs). If the incoming signal exceeds the threshold at the reference time of 1.7µs, a pulse train has to be created. This pulse train outputs a 1 every 0.8µs starting at 1.7µs. The pulse width is not of importance as I want to use this signal as a trigger for a sample and hold block afterwards. If the incoming signal does not exceed the threshold at 1.7µs, the output has to stay at 0. The problem now is that I dont know how to implement this.
Thank you in advance,
Thomas

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 10 月 20 日
Use Step block to specify time and value. This is your threshhold.
Use Comparator block to compare your incoming signal with this threshold. Use the output to control a Switch block.
Switch between whatever value and 'simulink/Discontinuities/PWM' block.

カテゴリ

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