필터 지우기
필터 지우기

Highlight Simulink model lines with custom colors

조회 수: 11 (최근 30일)
Gagik Hakobyan
Gagik Hakobyan 2011년 8월 17일
Hello Matlab Community,
Is there a way to highlight simulink model lines with predefined custom colors set?. I have used 'HiliteAncestors' line property, but 6 colors are available to use. Also, if i save the design and reopen, the previously set colors are disappeared, I see, that simulink does not save this line attribute.
Any ides?, Please help me
Thanks, Gagik

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 8월 17일
The HiliteAncestors property is currently documented as "internal use only" - so I'm not sure where you got example usage from. I think this property is related to the hilite_system function which is used to temporarily highlight blocks/subsystems (for example, in case of an error). The highlighted colors are therefore not saved to the model.
The more appropriate property for you to use is the block ForegroundColor property. You can either use one of the pre-defined colors: black, white, gray, red, orange, yellow, green, darkGreen, blue, lightBlue, cyan, magenta; or specify custom colors by using RGB values. For example:
set_param(gcb, 'ForegroundColor', '[0.2 0.8 0.4]')
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2011년 8월 17일
I see. Setting the foreground color of a block will make all the output signal lines of that block that same color. Not exactly what the OP wants but better than nothing.
Kaustubha Govind
Kaustubha Govind 2011년 8월 17일
If I understand correctly, the OP wants a given block and it's ancestors to have the same color. I don't think this is possible directly, but it might be fairly straightforward to write a simple function to do this by recursing up through parents using get_param(gcb, 'Parent').

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by