MATLAB Answers

Sunu
0

How to change color of a block in simulink when you perform copy

Asked by Sunu
on 13 Apr 2015
Latest activity Commented on by Avhidipta Mondal on 25 Nov 2017
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 Comments

Sign in to comment.

Products

1 Answer

Answer by Sebastian Castro on 13 Apr 2015

You can use block callbacks to do this.
  1. Right-click the block and select "Properties"
  2. Go to the "Callbacks" tab
  3. Enter the following code (for example) in the CopyFcn callback:
set_param(gcb,'BackgroundColor','red');
- Sebastian

  2 Comments

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.
Right click on the block, Select format, Background color.

Sign in to comment.