How can I use parsim in combination with a Simulink Variant Subsystem
Mostrar comentarios más antiguos
Hello,
I included a Variant Subsystem into the following Simulink-model (which is just an example) and run it with "parsim" via a script. Thereby I get this error message, that I don't understand:
-------------
Error due to multiple causes.Caused by:
Variant control 'Variant_1' of variant block 'sldemo_suspn_3dof_variant/Variant Subsystem' must be a condition expression or name of a Simulink.Variant object in the global scope workspace of the model. Ensure that the condition does not match the model name.
Variant control 'Variant_2' of variant block 'sldemo_suspn_3dof_variant/Variant Subsystem' must be a condition expression or name of a Simulink.Variant object in the global scope workspace of the model. Ensure that the condition does not match the model name.
-------------
The Simulink.Variants Variant_1 and Variant_2 and the parameter Variant_Switch are all part of the workspace.


mdl = 'sldemo_suspn_3dof_variant';
isModelOpen = bdIsLoaded(mdl);
open_system(mdl);
delete(gcp('nocreate'));
Variant_Switch = 1;
Cf_sweep = Cf*(0.05:0.1:0.95);
numSims = length(Cf_sweep);
for i = numSims:-1:1
in(i) = Simulink.SimulationInput(mdl);
in(i) = setBlockParameter(in(i), [mdl '/Road-Suspension Interaction'], 'Cf', num2str(Cf_sweep(i)));
end
out = parsim(in, 'ShowProgress', 'on');
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Component-Based Modeling en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!