Borrar filtros
Borrar filtros

GUI IN MATLAB 2021B, HOW TO SELSCT LISTBOX

3 visualizaciones (últimos 30 días)
yasmeen hadadd
yasmeen hadadd el 23 de Jul. de 2024
Comentada: Walter Roberson el 23 de Jul. de 2024
HI
how i change the color map of figure in GUI by ListBox Items:{ jet hot cool .....} using GUI
  3 comentarios
Walter Roberson
Walter Roberson el 23 de Jul. de 2024
selected_colormap = Items{app.ColormapListBox.Value};
That should be
selected_colormap = Items{app.ColormapListBox.ValueIndex};
Walter Roberson
Walter Roberson el 23 de Jul. de 2024
Better would be
function ColormapListBoxValueChanged(app, event)
selected_colormap = app.ColormapListBox.Value;
colormap(app.UIAxes, selected_colormap)
end

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 23 de Jul. de 2024
Create a listbox with the colormap names. Set the callback for the listbox to execute
Colormap_name = app.LISTBOXNAME.Value;
colormap(app.FIGURENAME, Colormap_name);

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by