Is it possible to delete a Simulink block from the block's callback function?
Show older comments
I would like to create singleton Simulink blocks. In other words, if a user tries to create a copy of the Simulink block, the copy should automatically get deleted. I have tried to implement this in the block's CopyFcn callback. But the block does not get deleted, and I get the following warning:
Warning: Error evaluating 'CopyFcn' callback of Sin block 'mymodel/Sine Wave1'. Error using ==> delete_block
Cannot delete 'mymodel/Sine Wave1' while in a callback.
Accepted Answer
More Answers (0)
Categories
Find more on Event Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!