How can you change the color of a block based on the input value?
12 次查看(过去 30 天)
显示 更早的评论
I am trying to get the 'Display' block color in Simulink. Based on the input value, if it is within a certain range, I want the color to change to indicate the change to the user beyond just the number reading. How can I do so? Thanks!
0 个评论
回答(1 个)
Sebastian Castro
2015-4-29
The first thing I could think of was creating a MATLAB Function block that checks the signal incoming to the block. In this block, you can use the following command to change your block colors:
set_param('modelName/blockName','BackgroundColor','red');
I've attached a screenshot:
- Sebastian
2 个评论
Sebastian Castro
2015-4-29
What kind of issues? Do you have an error message, or does the block color simply not change?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!