Add simscape blocks programmatically

조회 수: 7 (최근 30일)
Grzegorz Diaczek
Grzegorz Diaczek 2022년 12월 20일
댓글: Mana 2025년 2월 21일
Hello,
I tried to add a simscape block programmatically, using 'add_block()' function.
add_block('Simscape/Foundation Library/Electrical/Electrical Sources/Controlled Current Source',[gcb,'/Current Load'])
The following error occured:
There is no block named 'Simscape/Foundation Library/Electrical/Electrical Sources/Controlled Current Source'
I check if there is no mistake in path definition, also the simulink and simscape has been loaded using 'load_system()' function. Using simple command to built-in library works fine:
add_block('built-in/Gain',[gcb,'/Current Load'])
Thanks for help.
  댓글 수: 1
Mana
Mana 2025년 2월 21일
I have the same problem and have not found a solution. I am interested if you know the solutions.

댓글을 달려면 로그인하십시오.

답변 (1개)

Chetan Bhavsar
Chetan Bhavsar 2022년 12월 20일
  댓글 수: 1
Grzegorz Diaczek
Grzegorz Diaczek 2022년 12월 20일
Thank you for your answer. Unfortunately, the output of gcb when block is right clicked in Library Browser is empty.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by