A new block named 'data1' cannot be added

I am using for loop to create workspace variable block and conveter block and connect it.
While reaching at add block it gives error A new block named 'data1' cannot be added.
data =__ % defined in column
sys='testModel';
add_block('built-in/FromWorkspace',[sys, char(data(i))],'Position',pos1);

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2022년 2월 14일

0 개 추천

Most likely it is because a block with the same name already exists. Use the 'MakeNameUnique', 'on' option.
[sys, char(data(i))] is probably not right. Don't you want 'testModel/Data1' with the '/' seperator?
Vineela
Vineela 2023년 4월 22일

0 개 추천

'testModel/Data1'

카테고리

도움말 센터File Exchange에서 Event Functions에 대해 자세히 알아보기

제품

릴리스

R2017b

태그

질문:

2022년 2월 12일

답변:

2023년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by