How to programmatically change Simscape block pop-up parameters?
Ältere Kommentare anzeigen

There's this pop-up parameter in Simscape block, and I need to change it through commands.
However, I tried the following commands, none of them worked. While these commands caused no error at all, the simulation results were the same when the value was changed. Besides, I found that the pop-up parameters are not actually 'pop-up' type behind mask. Instead, they are 'edit' type.
% com 1
set_param(gcb,'winding_type','ee.enum.statorconnection.wye')
% com 2
mdl = "E6_PC";
open_system(mdl);
in = Simulink.SimulationInput(mdl);
in = in.setBlockParameter('E6_PC/PMSM_delta/PMSM','winding_type','ee.enum.statorconnection.wye');
out = sim(in);
Antworten (1)
Sabin
am 15 Dez. 2022
0 Stimmen
You can use set_param to change the value of the dropdown:
>> set_param(gcb,'winding_type','ee.enum.statorconnection.wye')
>> set_param(gcb,'winding_type','ee.enum.statorconnection.delta')
Alternatively you can use the numerical values:
>> set_param(gcb,'winding_type','1') % wye
>> set_param(gcb,'winding_type','2') % delta
Kategorien
Mehr zu Variable Initialization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!