Borrar filtros
Borrar filtros

Using data from a CompiledSimulink object to set model initial conditions.

1 visualización (últimos 30 días)
SB
SB el 17 de Nov. de 2022
Editada: Alvaro el 23 de En. de 2023
I must run an existing Simulink model with a large number of different configurations. Currently, the configuration parameters in the model are rendered through constant blocks and initial conditions using variables in the base workspace.
Since I am running many different configurations, I have decided to use the parsim() function with an array of simulationInput objects that reference this existing Simulink model. There are also many existing scripts setting variables in the base workspace that are meant to configure the simulation.
My approach for parallelizing the simulations is to save the workspace variables in a .mat for each configuration, then use the loadVariablesFromMATFile() funtion to set the model variables for each simulationInput object.
The problem I am running into is one of the variables generated in the base workspace is a CompiledSimulink object that contains member variables of interest. When blocks try to access this object's member variables (ex. CompiledObject.output.x) to set their initial values, an error is thrown, that "Dot indexing is not supported for variables of this type."
Are CompiledObjects not allowed to be used as a Simulink model variable in this way? Thank you in advance.
  1 comentario
Alvaro
Alvaro el 23 de En. de 2023
Editada: Alvaro el 23 de En. de 2023
I need some clarification on a couple points:
  1. Where is the CompiledSimulink class? Is it a custom class you made? I am having trouble finding this in the documentation.
  2. Does your approach work in serial but breaks down in parallel?
Also, you should be able to attach variables as properties of the Simulink.SimulationInput objects:

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by