If I use the built in menu function, can I then use "switch" and call the "case" by the order it appears on the menu?
조회 수: 2 (최근 30일)
이전 댓글 표시
choice = menu('Choose an option!','Set user name', 'Load data file');
switch choice
case 1
% Set user name
set_user_name();
case 2
% Load data file
댓글 수: 0
채택된 답변
Image Analyst
2016년 11월 18일
Of course? Why wouldn't you be able to? And it looks like you actually tried it so don't you already know the answer?
댓글 수: 2
Image Analyst
2016년 11월 18일
No quotes. Just do it exactly like you had it. Anyway, it's easy enough to try both ways if you weren't sure.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!