switch
5 ビュー (過去 30 日間)
古いコメントを表示
any good example of a 'switch' command , actually I need to make a code which when executed give me a option of selection and by pressing it it will execute that. Any Help in this .cheers
0 件のコメント
回答 (2 件)
Jan
2012 年 2 月 27 日
5 件のコメント
Jiro Doke
2012 年 2 月 27 日
Just combined the first examples from each function...
choice = menu('Choose a color','Red','Blue','Green');
switch choice
case 1
disp('You pressed Red');
case 2
disp('You pressed Blue');
case 3
disp('You pressed Green');
otherwise
disp('You closed the window');
end
参考
カテゴリ
Help Center および File Exchange で Instrument Control Toolbox Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!