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

63 views (last 30 days)
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 Comments

Sign in to comment.

Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by