Simulink "globals" not working as expected
古いコメントを表示
I have an open loop simulink model. It runs one time step and stops. I would like some of the intermediate data for run i to be available in run i+1. I have tried to use Data Stores. I write the intermediate data to them on run i and then have a read on i+1 that tries to use them. All that happens is it passes back the initialzed value each time. Is there a way to use Data Stores as I am attempting to use? If not, can you suggest an alternative? Thanks!
6 件のコメント
Walter Roberson
2022 年 7 月 30 日
編集済み: Walter Roberson
2022 年 7 月 31 日
It looks to me as if PostLoadFcn callback might be the appropriate place to initialize the contents of the global variables the first time. I suspect that you are possibly using InitFcn callback at the moment
Daniel Harman
2022 年 7 月 31 日
Walter Roberson
2022 年 7 月 31 日
You would attach it to the model itself. Load the model, have the model PostLoadFcn callback set the initial values for the Data Store
Fangjun Jiang
2022 年 8 月 1 日
First, please clarify "run i", "run i+1" is "runs one time" or "runs one time step"? "i+1" is the next simulation run, or the next simulation time step?
Walter Roberson
2022 年 8 月 1 日
next simulation run is my understanding
Daniel Harman
2022 年 8 月 1 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で String についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!