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 CenterFile Exchange에서 2-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