Get multiple variables in an input
5 ビュー (過去 30 日間)
古いコメントを表示
What I want to do is to get separate variables for the user inputted "row" and "column". Is there a function I can use to do this? My code so far is:
prompt= 'Enter your next move (‘row’ space ‘column’)'
0 件のコメント
回答 (1 件)
per isakson
2015 年 11 月 10 日
編集済み: per isakson
2015 年 11 月 10 日
Run
cac = inputdlg( 'Enter your next move ( row,col;row,col;...)' );
num = str2num( cac{:} )
and input:   1,2;3,4;5,6.   and get the output
num =
1 2
3 4
5 6
The user may also input two (or any number) whole numbers separated with space.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!