How to add a custom library using add_block?
이전 댓글 표시
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
2019년 10월 10일
Your syntax is not correct.
open_system('SourceLibFileName')
add_block('SourceLibFileName/RADAR','DestModelFileName/BlockName')
댓글 수: 5
Sinem Erdogan
2019년 10월 10일
Fangjun Jiang
2019년 10월 10일
Make sure your library model is loaded or opened. Make sure whatever your new model is created or opened, and then run the add_block() command.
Sinem Erdogan
2019년 10월 11일
Fangjun Jiang
2019년 10월 11일
You have an extra character "↵" in the block name in the library, most likely a carriage return. Remove it.
Sinem Erdogan
2019년 10월 11일
카테고리
도움말 센터 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!