How to programmatically change Simscape block pop-up parameters?
이전 댓글 표시

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);
답변 (1개)
Sabin
2022년 12월 15일
0 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Variable Initialization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!