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

조회 수: 171 (최근 30일)
Sunu
Sunu 2015년 4월 13일
댓글: Avhidipta Mondal 2017년 11월 25일
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

답변 (1개)

Sebastian Castro
Sebastian Castro 2015년 4월 13일
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
VENKATA PRASANTH KUMAR VULIMIRI
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.
Avhidipta Mondal
Avhidipta Mondal 2017년 11월 25일
Right click on the block, Select format, Background color.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by