Function Block using different thresholds

3 ビュー (過去 30 日間)
Sam Fennell
Sam Fennell 2017 年 4 月 19 日
コメント済み: Sam Fennell 2017 年 4 月 20 日
Hi,
I'm using a Matlab function block to give an output based on the difference between two temperatures. However, I want the output to come on above a certain threshold but not automatically go off below this threshold. e.g. I want it come on when T1-T2>8 but only go off when T1-T2<4
i.e.
T1-T2>8, Output=5
T1-T2<4, Output=0
I've tried different configurations of if,elseif,else but cannot seem to be able to write the script that will produce this. Can anyone help with this?
Thank you,
Sam.

採用された回答

Sebastian Castro
Sebastian Castro 2017 年 4 月 20 日
Have you looked into the Relay block? Seems like a good fit for what you want to achieve.
Sebastian
  1 件のコメント
Sam Fennell
Sam Fennell 2017 年 4 月 20 日
Thank you very much Sir, it worked perfectly.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by