필터 지우기
필터 지우기

Use UICONTROL for listbox

조회 수: 8 (최근 30일)
Amanda
Amanda 2013년 5월 29일
I need to use uicontrol to create a listbox. Instead of changing the variables each time the script is executed, I want to be able to change it on a GUI screen. So my list is composed of 5 variables:
mass
velocity
time
acceleration
speed
and these 5 variables have data.
Thanks,
Amanda

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 29일
편집: Azzi Abdelmalek 2013년 5월 29일
yourcell={'mass','velocity','time','acceleration','speed'}
uicontrol('Style', 'listbox','Position',[100 100 200 200],...
'string',yourcell,'Callback',@yourfunction)
%---------------add your function---------------------
function yourfunction(hObj,event)
v=get(hObj,'value')
%do
end
  댓글 수: 1
Amanda
Amanda 2013년 5월 29일
Thanks a lot.

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

추가 답변 (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