could anyone help me how to change the color of randomly distributed users within a cell

1 次查看(过去 30 天)
I am randomly generating 12 users within a cell with one base station.
firstly all the 12 users should be in the same color at the time of generation.
after generation the colors needs to be changed such that the first minimum distance user and first maximum distance user from the base station should be the same color.
the second minimum and second maximum should be of another color.
the third minimum and third maximum should be of another color and goes on.

回答(1 个)

Walter Roberson
Walter Roberson 2019-2-8
编辑:Walter Roberson 2019-2-8
Cell arrays cannot have colors.
command window text can have a limited range of colors. The file exchange contribution cprintf is by far the easiest way to use them. https://www.mathworks.com/matlabcentral/fileexchange/24093-cprintf-display-formatted-colored-text-in-the-command-window
A few kinds of uicontrol can have html colors . It is aa nuisance to figure out the correct attributes so it is easier to adapt a working example such as I have posted in the past.
graphics objects control color under attributes that might be named Color or ForegroundColor or CData depending on the kind of graphics object . The ones that use Color or ForegroundColor can only have one color per graphics object; the ones that use CData can use different colors for different parts of the same object .

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by