how to enable continuous-time matlab functions to initialized persistent variables

62 ビュー (過去 30 日間)
Daniel Sadono
Daniel Sadono 2021 年 7 月 7 日
コメント済み: Daniel Sadono 2021 年 7 月 24 日
Hi, I have problem to start the simulation model in 2018b. The model was simulated flawless in matlab 2016b, however problem occur in 2018b
" MATLAB Function uses constructs that are invalid when the block specifies or inherits a continuous sample time. Invalid constructs include the use of persistent or global variables, calls to exported functions or using coder.extrinstic. Suggested Actions Set sample rate of this block to inherit the fastest discrete rate in the model. Fix Open the properties dialog of this block to set the sample time manually."
I've searched in other links, who suffered the same problem such as Migrating from Matlab 2015b to 2017b error - MATLAB Answers - MATLAB Central (mathworks.com), but the problem didn't solved yet. I found the problem starts at version 2017B. Then, I found on matlab Enable continuous-time MATLAB functions to write to initialized persistent variables - MATLAB & Simulink (mathworks.com), which I'm sure that this one is the solution (they mentioned it, that continuous time for persistents variables was turn off by default starting 2017b).
However, the problem still can't be solved, because on "Simulation Target" and "advanced parameter" as it mentioned, I still didn't find the option"Enable continuous-time MATLAB functions to write to initialized persistent variables"
Can anyone help this one? Thank you
  4 件のコメント
rajmouli jujjavarapu
rajmouli jujjavarapu 2021 年 7 月 23 日
hello, I'm Raj, I would like to mention that I have tried using Delay block as I'm trying to simulate an OFDM system. This also doesn't give a continous time. Please let us Know if your problem is fixed. It would help me as well.
Thank you
Daniel Sadono
Daniel Sadono 2021 年 7 月 24 日
@rajmouli jujjavarapu Have you tried to use memory block? or you can try also Rate Transition Block.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by