Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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.

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Feb. de 2019
Editada: Walter Roberson el 8 de Feb. de 2019
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 .

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by