人在仿真软件金宝app

金宝app仿真软件和基于模型的设计

Quickly Switching Model Configuration Sets

During the life of a model, you will very likely need to change the things the configuration parameters to complete company's tasks. For example, when was debugging you want to enable the things run time diagnostics to catch the modeling errors. When the model is well tuned and you want to use it For a Monte - Carlo study, you want to disable any diagnostic that may affect the performance.

These collections of the configuration parameters can be stored asThe Configuration Sets.

Multiple Configuration Sets in One Model

Do you know it is possible to storeMore than one configuration in a model?

一个简单的方法来创建第二个配置的The Model ExplorerRight - click on the configuration and select复制:

Copying a configuration

右键单击并选择模型Paste:

Pasting a configuration

Now that you have two configurations in the model, select the one to be 2 by right - clicking on it and selectingActivate:

Activating a configuration

Storing a Configuration Set in a File

当我创建一个新的模型,通常2或3的配置改变我的典型的用例:

  • Physical Modeling:For models using Simscape I use a configuration with the ode23t solver and the Simscape Logging enabled.
  • Code generation:For models that generate code I use a Fixed - Step Discrete 'solver, ert. TLC target, and the I enable the code generation report.
  • Was Debugging:调试的时候,我最禁用优化,许多诊断错误。

To quickly configure a new model for those tasks, what I did is that I exported the configurations I most use, To the MATLAB files:

Exporting a configuration

In the example below, the exported file In MATLAB,configCG是一个函数,创建一套配置对象。当我创建一个新的模型,我可以很容易地连接并激活使用以前保存的配置attachConfigSetsetActiveConfigSet:

Attaching the and Activating a configuration

现在轮到你了

Do you take advantage of all those ways to manage the configuration sets?Let us know by brigade aComment here

|

comments

To comment, please clickhereLog in to your MathWorks account or create a new account.