How to update function's variables each sample time

1 Ansicht (letzte 30 Tage)
mohamed ehab
mohamed ehab am 3 Sep. 2019
Beantwortet: Fangjun Jiang am 3 Sep. 2019
I created a matlab function which implements DMC controller as shown , the problem is there are few vectors inside the function needs to get updated each sampling time , So is there a way to save data after each sampling time to be used for the next ones?
note: " save " function is not supported in simulink's code generation for some reason

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 3 Sep. 2019
Use persistent variables

Weitere Antworten (0)

Kategorien

Mehr zu Model Predictive Control Toolbox finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by