Hotfix: renaming the script that was previously called (and then removed) works. I think this is a bug that needs fixing but I'll accept my own answer for now.
Simulation cannot be saved due to error in callback functions (script-as-function call error)
7 ビュー (過去 30 日間)
古いコメントを表示
Claudius Rosendahl
2022 年 11 月 29 日
回答済み: Claudius Rosendahl
2022 年 11 月 29 日
I thought it would be smart to use a script to set parameters for my simscape simulation. I put the script in the callback InitFcn. Got an error when saving the simulation. It read "Error evaluation PreSaveFcn call back of <random block in my simulation>. [...]"
I removed the script from the callback function (InitFcn). Still got the same error. O/C I looked into the callback Fcn named in the error (PreSaveFcn), but it is empty.
My simulation cannot be saved anymore. I tried restarting MATLAB to clear the cache. Did not work. This problem can be reproduced by creating a simulation, editing the InitFcn, using a script in it and then saving. You get the error. Then remove the script call from the InitFcn. You should still get the error.
EDIT: I can also no longer run the Simulation.
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Troubleshooting についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!