How to change the parameter in Mask and run the simulation parallel
조회 수: 1 (최근 30일)
이전 댓글 표시
I had a model which includes two subsystem and already masked. I can extrcat the parameter with Code
Simulink.Mask.get
And If I run the simulations parallel by using parsim or parfor, how can I change the parameter in Mask?
Thanks very much!
댓글 수: 0
답변 (1개)
Edric Ellis
2022년 4월 22일
Given a simple model like this which has a mask with a parameter named gain_val
You need to do something like this:
mdl = 'mask_parsim';
block_name = '/MyMask';
param_name = 'gain_val';
for i = 10:-1:1
in(i) = Simulink.SimulationInput(mdl);
in(i) = setBlockParameter(in(i), [mdl block_name], param_name, ...
num2str(i));
end
out = parsim(in, 'ShowProgress', 'on');
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!