combine 2 string to a listbox

2 views (last 30 days)
Rahma Yeni
Rahma Yeni on 18 Apr 2012
Hello... Like my question in http://www.mathworks.com/matlabcentral/answers/31729-make-history, I want to combine string from a popupmenu and 2 edittexts.. Example: the strings of popupmenu are
apple
mango
grapes
Then when i choose "mango", and in an edit text, i make the value is 80, in listbox it will be "mango, 80".. But, only "mango" and "grapes" that have edittext.. where, "mango" and "grapes" take the value from their text field. How i can combine them..?? i illustrate it like this http://www.flickr.com/photos/rye_ni/6969686871/. I have try to use these code, but they're not work..
pmFruitVal = get(handles.pmFruit, 'Value');
pmFruitStr = get(handles.pmFruit, 'string');
pmFruitSlc = pmFruitStr {pmFruitVal };
valFruit = str2num(get(handles.eFruit, 'String'));
if (pmFruitVal >1)
handles.cnt = handles.cnt + 1;
histstr = horzcat(pmFruitSlc, ', ', valFruit);
handles.history{handles.cnt} = histstr;
set(handles.listFruit, 'string', handles.history);
end
guidata(hObject,handles);
I really need your help.. i have try all of my ability.. But i can't get it.. Thank You.. :)

Answers (0)

Categories

Find more on MATLAB Report Generator in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!