필터 지우기
필터 지우기

set handles function for char data.

조회 수: 1 (최근 30일)
sermet
sermet 2013년 7월 18일
%I have a data which class is char. I need to write this data into listbox in my GUI.
tp=0.99954;
scale_ppm=(tp-1)*10^6 %ppm
scale=sprintf('scale %10.4f ppm \n',scale_ppm) %char
%I want to assign "scale" into listbox in my GUI. Which function I need to use?
thanks in advance.
  댓글 수: 1
Jan
Jan 2013년 7월 18일
Omit the linebreak in the string.

댓글을 달려면 로그인하십시오.

채택된 답변

David Sanchez
David Sanchez 2013년 7월 18일
Your listbox has to have a tag assigned (look for it in the property inspector). The values you want to insert into your listbox should be part of a cell array.
scales = cell(num_elements,1);
for k=1:num_elements
scales{k} = your_strings_here;
end
set(handles.your_pop,'String',scales);
  댓글 수: 4
sermet
sermet 2013년 7월 18일
I've mistakenly write listbox, it was actually edit. These codes are acceptable for edit text?
Jan
Jan 2013년 7월 19일
Simply try it, sermet. You will find out, that the same code is working for all kinds of uicontrol's (while I'd avoid multi-line text checkboxes).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by