主要内容

Undo and Redo Model Changes in SimBiology

While a model is open in one (or both) of the SimBiology apps, you can undo and redo model building and diagram configuration actions you take in the apps or at the command line. Model building activities include changes to the model, variants, doses, and配置集object (仿真设置). Model diagram configuration actions include joining and splitting species blocks, and making changes to block and line properties, such as to block position, block shape, and line color.

无论您是在应用程序中还是在命令行中执行操作,都只能通过使用Undo或者Redobutton in theSimbiology模型Builder应用程序。

撤消和重做的动作历史是特定于模型的。因此,如果您的项目中有几个模型,则每个模型都保持着自己的撤消或重做的动作列表。从项目中删除模型可以清除该模型的动作历史记录。关闭两个应用程序都清除了项目中所有模型的所有动作历史。

Each time you undo or redo, the模型Builderapp:

  1. 在状态栏中显示一条消息,指示最后一个修改是什么。

  2. Changes the focus as follows:

    • If a model property or model diagram is changed, theDiagramtab is open and selected.

    • If a variant property is changed, the变体tab is open and selected.

    • If a dose property is changed, theDosestab is open and selected.

    • 如果更改在模型中配置集object (or仿真设置在应用程序)中,该应用仅显示状态栏中的消息,并且不会改变焦点。

模型Changes in Model Analyzer App

You can undo model changes made within the模型分析仪应用程序。You still need to use theUndoRedobuttons in the模型Builder应用程序。Specifically, you can undo the following actions originating from the模型分析仪app:

  • 后处理:计算可观察结果step

  • Committing slider values for quantities and doses from theExplorer到模型

  • 从滑块,估计的参数值或仿真数据创建变体

Undo Deletion of Model Components

You can undo and redo the deletion of model components (such as species or parameters) of a model but the deletion of a model object is not supported for undoing and redoing. You can delete a model component by using the删除key or context menu option in the模型Builderapp or by calling the删除function at the command line.

At the command line, if you have a variable referencing a model component that you have deleted, after undoing the deletion, you need to do an additional step to retrieve the model component using dot indexing,get, orsbioselect. This step lets you continue using the variable to update the properties of the model component.

To illustrate this point, consider a modelm1open in the模型Builderapp and exported to the MATLAB®工作区。你有变量s1引用模型物种,您使用s1改变物种特性,例如其价值。

s1 = sbioselect(m1,'Type','species','Name','s1'); s1.Value = 10; delete(s1);
After the删除call,s1is displayed as a handle to the deleted species.

>> s1 s1 = handle to deleted Species

Next, you clickUndo在里面模型Builder应用程序。该物种再次出现在应用程序中。但是,在命令行,s1still displays as a handle to the deleted species. You cannot uses1to change the species properties as before. To retrieve the species, you need to useget, dot indexing, orsbioselect.

% Retrieve the species using dot indexings1 = m1.Species(1);% Or retrieve using sbioselects1 = sbioselect(m1,'Type','species','Name','s1');% Continue using the variable to change the object propertiess1.Units ='microgram/milliliter';

Note

If you delete thenth model component in the model and undo the deletion, the model component is restored as thenth component.

Actions Not Supported for Undoing or Redoing

您不能撤消或重做以下操作。

  • 从项目中删除模型。您可以通过将模型从MATLAB工作区导入到应用程序中,将其添加回该模型,但是在从项目中删除模型之前,您不能撤消或重做更改。

  • Deletion of a model.

  • Configurations for unit, unit prefix, and abstract kinetic law.

  • App-specific configurations, such asPreferences.

  • Diagram configurations not specific to the model, such as zoom level or panning.

See Also

||||||||||||||||