Copying a block and dynamically changing the name and sub block names.
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rodolfo Villanueva
am 9 Jan. 2019
Kommentiert: Rodolfo Villanueva
am 11 Jan. 2019
I have several blocks, all of which contain a matlab script and input/outputs with To Workspace blocks to log the data. I would like to be able to copy a block, and dynamically when changing the copied block name, for the To Workspace variable name to change accordingly.
I know this can be done with a callback and set_param, but my problem is the block path: When copying/pasting a block, a new path is generated, but this new path is not considered in the callback, therefore it will only change the original block.
Is there a way to dynamically write the path of a block in a callback or code, such that if I copy and paste this block, the aforementioned situation works?
Thanks!
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 9 Jan. 2019
The question is not very clear. You might be able to use gcb, gcbh, getfullname().
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Model, Block, and Port Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!