A new block named 'data1' cannot be added
Ältere Kommentare anzeigen
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);
Antworten (2)
Fangjun Jiang
am 14 Feb. 2022
0 Stimmen
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
am 22 Apr. 2023
0 Stimmen
'testModel/Data1'
Kategorien
Mehr zu Event Functions finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!