List box with strings, Append those strings in the title of the figures when clicking on it.?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a List box. Which has strings say red, blue, green. An image is also there. when clicking the red, it should appear on the title of the figure, likewise next by clicking blue, it should append with red, likewise green also.
0 comentarios
Respuesta aceptada
Image Analyst
el 17 de Ag. de 2012
Get the string property of the listbox to get all the items in the listbox. Get the value property to get which one on selected and use that as an index into the list of all the items. Then use sprintf() to create your string and use title() to display it atop the image.
0 comentarios
Más respuestas (1)
Sean de Wolski
el 17 de Ag. de 2012
figure;
imshow('cameraman.tif');
str = {'red','green','blue'};
hL = uicontrol('style','list','string',str,...
'callback',@(src,evt)title(sprintf('Color is: %s',str{get(src,'value')})));
Ver también
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!