How do i implement interactive input of multiple variables?

6 vues (au cours des 30 derniers jours)
Alex
Alex le 2 Août 2012
I need to run a program which is plotting fluid streamlines. I have the program working except the user input from the command line.
What i want is for the program to ask "What are the w x y z details of the streamline?", where w x y and z represent 4 different variables, and have them read into the program.
I was trying this using the 'input' command but can only do it with one number at a time.
I thought this may work for multiple variables but it didn't:
[x_init, y_init, h, tmax]=input('Enter details of 1st streamline (x_init, y_init, step size, run time:');
x_init, y_init, h, tmax are the variables i wish to input from the command line and be used in the program.

Réponses (1)

Oleg Komarov
Oleg Komarov le 2 Août 2012
answer = inputdlg({'x','y','z','w'},'Title')

Catégories

En savoir plus sur 2-D and 3-D Plots 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