- Right-click the block and select "Properties"
- Go to the "Callbacks" tab
- Enter the following code (for example) in the CopyFcn callback:
How to change color of a block in simulink when you perform copy
96 次查看(过去 30 天)
显示 更早的评论
I'm trying to create a way to automatically change block colors when you do a copy in the model. I know how to change the colors, now I just need to be able to either do the copy, or figure out how to trigger the color change when a copy happens
0 个评论
回答(1 个)
Sebastian Castro
2015-4-13
set_param(gcb,'BackgroundColor','red');
- Sebastian
2 个评论
VENKATA PRASANTH KUMAR VULIMIRI
2017-2-16
My call backs tab is not highlighting...hence i am unable to change my colour of block.Please tell me how i can get the exact colours.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!