Persistent variable clear after simulation with simulink
Ältere Kommentare anzeigen
Hello, i have a problem, where I need help. I have decleared and initilized a persistent variable var in a Matlab Embedded Function in Simulink. For example
persistent var
if isempty(var)
var= 1
end
I noticed that the variable doesn't exist after the simulation end's. Thats why var is initialized again, when i start a simulation. Is this normal ? (I don't have any function in Model Property)
Akzeptierte Antwort
Weitere Antworten (1)
octus_ma
am 26 Mai 2016
0 Stimmen
Kategorien
Mehr zu Naming Conventions finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!