How to save a backup copy of a Simulink Model that is currently open and 'dirty'

5 ビュー (過去 30 日間)
Jesse Hopkins
Jesse Hopkins 2015 年 8 月 14 日
コメント済み: James Wiken 2015 年 8 月 18 日
I'm attempting to augment Simulink's autosave feature, as it seems that autosave is only performed when update diagram is performed. I'd like more frequent autosave, but that does not seem to be built in.
I whipped up a quick script using a timer object and save_system to try and do an autosave ~5 minutes, however I quickly found out that save_system behaves as if you've used the "Save As' option when saving to a different filename. The model's 'filename' property is changed to the new filename, the 'Dirty' flag is removed, and subsequent save operations go to the autosave location.
Does anyone know of a way to use save_system or some other method to save a copy of the model while keeping the model in memory 'Dirty', and not updating the 'filename' property? (I did try manually changing the 'FileName' property back to the original, but that generates an exception "block_diagram parameter 'FileName' is read-only".
Thanks.
  1 件のコメント
James Wiken
James Wiken 2015 年 8 月 18 日
Have you tried setting the 'OverwriteIfChangedOnDisk' option to 'true' in the 'save_system' function?
See the documentation link below:

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by