How can I modify the below code such that when clicking on a string from the list box, when clicking on another string it should append to the previously clicked string.
Show older comments
How can I modify the below code such that when clicking on a string from the list box, when clicking on another string it should append to the previously clicked string.
function [] = newnew()
S.fh = figure('position',[400 450 500 200],...
'name','GUI_pop_to_list');
S.pp = uicontrol('style','list',...
'min',0,'max',2,...
'position',[20 90 190 100],...
'string',{'building';'grass';'tree';'cow';'boat';'sheep';'sky';'mountain'});
S.ls = uicontrol();
S.pb = uicontrol('style','push',...
'position',[20 20 190 40],...
'string','Transfer',...
'callback',{@pb_call,S});
uicontrol(S.pp)
function [] = pb_call(varargin)
S = varargin{3};
E = get(S.pp,{'string','value'});
STR = get(S.ls,'string');
set(S.ls,'string',[STR;subplot(1,2,2);imshow('attachment.jpg');title(E{1}(E{2}))])
Accepted Answer
More Answers (0)
Categories
Find more on String Parsing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!