How do i implement interactive input of multiple variables?

6 ビュー (過去 30 日間)
Alex
Alex 2012 年 8 月 2 日
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.

回答 (1 件)

Oleg Komarov
Oleg Komarov 2012 年 8 月 2 日
answer = inputdlg({'x','y','z','w'},'Title')

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by