Can we set programmatically parameters of 'Permanent Magnet Synchronous Machine' block?

2 次查看(过去 30 天)
Hello,
Does anyone know how to set programmatically parameters inside this BLDC motor block (like the initial condition for example)?
Thanks in advance!
Nicolas

采纳的回答

Ayush Singh
Ayush Singh 2024-6-11
Hi Nicolas,
In order to set the parameters of 'Permanent Magnet Synchronous Machine' block, you can use 'get_param' and ' set_param' functions like below:
path = 'path_to_your_block';
h = getSimulinkBlockHandle(path,true);
get_param(h,'DialogParameters')
After executing the last line you will see list of Dialog parameters and then you can modify any parameter using 'set_param' for example:
set_param(h,'NbPhases','3')
% Here we are changing number of phases value to 3
For more information on above functions, refer the following links:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parameterization Methods 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by