How to add a custom library using add_block?

9 次查看(过去 30 天)
Hi, I created a custom library. This library contains only one subsytem block named RADAR. I am trying to use add_block and add this subsytem. Without any error the simulink file opens but the block does not appear. This is how I load my library.
load_system('libdeneme');
And these are some of the code lines I tried.
add_block('simulink/libdeneme/RADAR','autoCreateDeneme')
add_block('simulink/libdeneme/RADAR','autoCreateDeneme')
add_block('libdeneme/RADAR','autoCreateDeneme')
add_block('libdeneme/RADAR',)

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2019-10-10
Your syntax is not correct.
open_system('SourceLibFileName')
add_block('SourceLibFileName/RADAR','DestModelFileName/BlockName')
  5 个评论
Fangjun Jiang
Fangjun Jiang 2019-10-11
You have an extra character "↵" in the block name in the library, most likely a carriage return. Remove it.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by