필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
SB
SB 2022년 11월 17일
편집: Alvaro 2023년 1월 23일
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
Alvaro
Alvaro 2023년 1월 23일
편집: Alvaro 2023년 1월 23일
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:

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by