Saving/Loading the SimState Programmatically
古いコメントを表示
I have a problem with saving/loading SimState programmatically. It works when i do it manually in the Simulink settings, but when doing it in a m file i get an error. My code is simply
simfile = 'simfile';
set_param(simfile, 'SaveFinalState', 'on', 'FinalStateName','SimState','SaveCompleteFinalSimState', 'on');
set_param(simfile, 'LoadInitialState', 'off');
simOut = sim(simfile,'StopTime',num2str(10));
set_param(simfile, 'SaveFinalState', 'off');
set_param(simfile, 'LoadInitialState', 'on', 'InitialState','SimState');
simOut = sim(simfile,'StopTime',num2str(20));
resulting in an error
??? Error using ==> simtest at 10
Error evaluating expression 'SimState' for 'Initial state' specified in the Configuration Parameters dialog for block diagram 'simfile': Undefined function or variable
'SimState'.
What am i missing?
Thanks :)
Benjamin
採用された回答
その他の回答 (1 件)
Ronald Verhoeven
2011 年 2 月 26 日
0 投票
I have exactly the same problem. I didn't get the answer yet. Who could help me solving the above posted question? Thank you.
カテゴリ
ヘルプ センター および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!