Effacer les filtres
Effacer les filtres

Get multiple variables in an input

3 vues (au cours des 30 derniers jours)
Krish Desai
Krish Desai le 10 Nov 2015
Modifié(e) : per isakson le 10 Nov 2015
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’)'

Réponses (1)

per isakson
per isakson le 10 Nov 2015
Modifié(e) : per isakson le 10 Nov 2015
Run
cac = inputdlg( 'Enter your next move ( row,col;row,col;...)' );
num = str2num( cac{:} )
and input: &nbsp 1,2;3,4;5,6. &nbsp 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.

Catégories

En savoir plus sur Control Systems dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by