Understanding initial behavior of Requirement Table

4 ビュー (過去 30 日間)
Shubham
Shubham 2023 年 10 月 30 日
コメント済み: Shubham 2023 年 11 月 7 日
I am trying to understand the behavior of requirement table on initialization i.e. time = 0. The results are not what I am expecting, please provide some insight regarding this.
Issue: I have created a simple requirement table in which my output is difference of current Input value and previous input value(image1). Since I can not set initial value for my input, I decided to set initial value of my output(image2). But when I simulate the table, model does not reflect the set initial value and always shows output "0"(image3).
Expected Value: the initial value that I set should be the output at time = 0

採用された回答

Josh Kahn
Josh Kahn 2023 年 11 月 6 日
In R2022a, the getPrevious function is undefined at t = 0 so you will need to an alternative, such as isStartup, to handle that condition.
In R2023b, initial conditions are now supported and can be specified for u in the Property Inspector. See latest behavior here:
Hope this helps,
Josh
  1 件のコメント
Shubham
Shubham 2023 年 11 月 7 日
Thank you for your response.

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

その他の回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by