Converting a configuration reference to a configuration

22 次查看(过去 30 天)
Is there a way to convert a Simulink configuration reference set to a configuration?
I know that the other direction is facilitated by the Model Explorer. It allows to convert a model configuration to a configuration reference by simply right clicking on the configuration and selecting "Convert to Configuration Reference...". But I can't find a way back.

回答(1 个)

Kartik Saxena
Kartik Saxena 2023-11-21
Hi,
I understand that you want to convert 'Configure Reference' to 'Configure Set'.
In Simulink, a configuration reference is a way to apply the same configuration set across multiple models, ensuring consistency and ease of maintenance. However, once you convert a configuration set to a configuration reference, Simulink does not provide a straightforward built-in method to convert it back to a standalone configuration set within the user interface.
However, you can programmatically create a new configuration set based on the settings from a configuration reference. Here's how you can do it in MATLAB:
  1. Load the model that uses the configuration reference.
  2. Get the active configuration set (which is a reference).
  3. Create a new configuration set in the model with the same parameters.
The following MathWorks documentation contains detailed information about functions that can be used for this purpose:
  3 个评论
Kartik Saxena
Kartik Saxena 2023-12-4
Hi,
You don't need to loop over all the parameters of the configuration set. You can use several functions to copy all the parameters of the configuration at once.
Refer to the MathWorks documentations given below:
I hope this resolves your issue.
Ralf
Ralf 2023-12-5
I am really sorry. I don't get it from the supplied information.
What I did so far:
  • Created a model named Model1.slx with an active configuration reference ("ConfigSetRef").
  • Used ConfigObj= getActiveConfigSet('Model1'); to store the config set reference in variable "ConfigObj"
  • Used attachConfigSet('Model1', ConfigObj, true);
Alternatively I tried to use attachConfigSetCopy('Model1', ConfigObj, true);
Anyway, these commands resulted in attaching another Configuration Set Reference (ConfigSetRef) to the model. I couldn't find a way to attach a Configuration Set (ConfigSet) with the settings of ConfigObj to the model.
Could you please be a bit more precise on how to achieve this?
Thank you very much!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Model Configuration Sets 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by