MATLAB Answers

Is it possible to change the color of an object in Simscape Multibody during a simulation?

7 views (last 30 days)
Cyndia Cao
Cyndia Cao on 18 Mar 2020
Answered: Steve Miller on 5 Jun 2021
I would like to be able to visually communicate system parameters by the color of a body. For example, a linkage turns yellow when it gets within 10 degrees of its limits, or a wheel turns red when it stops turning, etc.
Is this possible? Or does anyone have any tricks to convey this information synchronously with the model animation?

Sign in to comment.

Accepted Answer

Steve Miller
Steve Miller on 5 Jun 2021
Through MATLAB release R2021a, you cannot cannot change the color of a solid based on an input signal. What you can do, though, is put another solid just behind it that has the new color, and then when you want the color to change move that solid in front of the other solid.
In the video in this LinkedIn post, we used a set of solids to have the battery color change gradually as it heats up:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!