COMPARE NEXT VALUE WITH PREVIOUS VALUE

Hi, I am using simulink. I have many values of x from a function. (1,2,3,4,5,6,7......)
I want to compare previous value with new coming value. Can you help me.
a function of coming value is f(x). a function of previous value is f(x-1).
I want f(x)/f(x-1) = Coming value / previous value.
Which block i use to store previous value. I cannot use DELAY BLOCK becuase it changes value. I tried to use memory block but not succeeded. I hope you can solve it. Thanks

1 件のコメント

TAB
TAB 2013 年 1 月 4 日
I cannot use DELAY BLOCK becuase it changes value....?????
If input to the unit delay block will change, its output will also change to hold the latest value.
What exactly you want to do ?

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

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 1 月 4 日
編集済み: Azzi Abdelmalek 2013 年 1 月 4 日

0 投票

You can use the unit delay block as well the memory block. Your problem is maybe the settings of these blocks, particularly the sample time. Set the sample time to -1 (inherited). Also another thing, after simulation, check the input and output of your unit delay block

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

製品

質問済み:

2013 年 1 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by