how do i create a signal which is reset to zero every time the input signal increases of 1?

3 ビュー (過去 30 日間)
Hello everybody,
I need a Simulink model capable to take an input signal (for instance a discrete ramp) and to provide an output signal (true/false) that detects whenever the input signal increases of a value of 1, as shown in the attachment. For instance, the output signal could be a 0-1 signal or a staircase signal with step height =1.
thanks to all!

回答 (1 件)

Jan
Jan 2023 年 1 月 30 日
signal2 = diff(signal) == 1;
  2 件のコメント
Giovanni Aldeuri
Giovanni Aldeuri 2023 年 1 月 30 日
Hey Jan, thanks for your answer. I was not completely clear in my question and now i changed it a bit. I would like to implement a Simulink model. I think i need a switch (which detecs when the input has increased of a value of 1), a unit delay and a subtracting block, but I'm not able to arrange them efficiently
Giovanni Aldeuri
Giovanni Aldeuri 2023 年 1 月 30 日
by the way, i found a solution with this:

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by