Error with parsim() while changing variables

조회 수: 9 (최근 30일)
Gaston Fermandois Cornejo
Gaston Fermandois Cornejo 2022년 9월 26일
댓글: Gaston Fermandois Cornejo 2022년 10월 1일
Hi Everyone,
I'm having the following problem with parsim(). I'm trying to run a Monte Carlo simulation of a Simulink model where I want to assign a different seed value to band-limited white noise (BLWN) block in each run. I defined all the parameters of this block as variables in Workspace, which are transferred as variables for the Simulink model workspace.
It appears my code successfully changes the values of the BLWN seed for each simulation, but unfortunately, I have errors, and the simulations are not run. I have attached the Matlab script and Simulink model to this message. Please help!
Thanks, Gaston

채택된 답변

Bala Tripura Bodapati
Bala Tripura Bodapati 2022년 9월 29일
Hi Gaston Fermandois
It is my understanding that the following errors are encountered while running Monte Carlo Simulation of a Simulink model using the 'parsim()' function:
  • Variable 'BlwnSampling' does not exist.
  • Variable 'BlwnPower' does not exist.
The above issues are encountered because of the invisibility of the variables used in the model and defined in the base workspace to the parallel workers. In order to resolve this issue, the 'TransferBaseWorkspaceVariables' property must be set to 'on' while calling the 'parsim()' function.
The following code illustrates how to set the 'TranferBaseWorkspaceVariables' property:
out = parsim(in,'ShowSimulationManager', 'on','TransferBaseWorkspaceVariables','on');
Please refer the parsim documentation for more information.
  댓글 수: 1
Gaston Fermandois Cornejo
Gaston Fermandois Cornejo 2022년 10월 1일
Thanks, Bala. This solution worked as a charm! Very much appreciated.
Best, Gaston.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Run Multiple Simulations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by