필터 지우기
필터 지우기

combine 2 string to a listbox

조회 수: 3 (최근 30일)
Rahma Yeni
Rahma Yeni 2012년 4월 18일
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.. :)

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by