why does the module of delay have different data types of input and output?

3 ビュー (過去 30 日間)
ED
ED 2024 年 9 月 18 日
コメント済み: ED 2024 年 9 月 19 日
  1 件のコメント
ED
ED 2024 年 9 月 18 日
編集済み: ED 2024 年 9 月 18 日
But I disable function of reset, it changes into:
Just overlook the different appearance of the delay with and without reset input.
Hasn't this case ever been found by anyone?

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

採用された回答

Epsilon
Epsilon 2024 年 9 月 18 日
編集済み: Epsilon 2024 年 9 月 18 日
Hi ED,
I tried reproducing this and it seems the unit delay block does indeed produce a 'double' data type signal when used with an external reset. This might be happening due to the initial condition (0.0) being of a ‘double’ datatype in case of the block with external reset. In case where no reset is being used it must be using the definition with the initial value (0) as ‘single’ datatype. The initial conditions change the datatypes for the next iterations. (Note: 0.0 & 0 are just the mentioned values in the parameter dialogue fields and does not represent the datatype of the values)
To get the signal as a 'single' datatype while using an external reset consider using a 'single' datatype value as an initial condition. To do so, directly enter a 'single' datatype value in the initial condition field in the Delay One Step’ block parameters dialogue. Or change the initial condition source from ‘Input’ to ‘Input port’ then attach a 'single' datatype constant to it.
Attaching the resultant image with the implementation.
Hope this helps!
  1 件のコメント
ED
ED 2024 年 9 月 19 日
thank you!
I just replaced 0.0 with single(0.0) when keeping dialog one and the result is adopting the single as well.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by