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.
Best Answer