PreSaveFcn Callback

11 ビュー (過去 30 日間)
Adrian Dronca
Adrian Dronca 2012 年 6 月 27 日
I want to save the model with a different name and get the model name of the previous model.
For example I have a model named 'model_A' and change it to 'model_B'
I set the PreSaveFcn callback, but in this callback i get the name of the new model 'model_B'.
How do i get the information for the old model ? Do I have to use a different callback ?
Thanks in advance, Adrian.

採用された回答

TAB
TAB 2012 年 6 月 27 日
Store the current model name in a variable and then save it with other name.
OldName = bdroot; % ie model_A
save_system(OldName, 'model_B'); save with new name;
  5 件のコメント
TAB
TAB 2012 年 6 月 27 日
You can do it by saving the model from a m-file as I suggested above.
Create your own Save As option in tool menu of the simulink GUI and call above code in the callback of that option.
See http://www.mathworks.in/help/toolbox/simulink/ug/bqt2_v7-1.html
Adrian Dronca
Adrian Dronca 2012 年 6 月 27 日
編集済み: Adrian Dronca 2012 年 6 月 28 日
I will try it, sounds good. I will give my feedback afterwards
Thank you.
Edit: It is working, thanks for the info

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by