Request user input
displays
the text in x
= input(prompt
)prompt
and waits for the user to
input a value and press the Return key. The user
can enter expressions, like pi/4
or rand(3)
,
and can use variables in the workspace.
If the user presses the Return key
without entering anything, then input
returns an
empty matrix.
If the user enters an invalid expression at the prompt, then MATLAB® displays the relevant error message, and then redisplays the prompt.
The Workspace browser does not refresh while input
is waiting for
a response from the user. Therefore, if you run input
within a
script, the Workspace browser does not display changes made to variables in the
workspace until the script finishes running.