| Contents | Index |
evalResponse =
input(prompt)
strResponse =
input(prompt, 's')
evalResponse = input(prompt) displays the prompt string on the screen, waits for input from the keyboard, evaluates any expressions in the input, and returns the value in evalResponse. To evaluate expressions, the input function accesses variables in the current workspace.
strResponse = input(prompt, 's') returns the entered text as a MATLAB string, without evaluating expressions.
If you press the Return key without entering anything, input returns an empty matrix.
To create a prompt that spans several lines, use '\n' to indicate each new line. To include a backslash ('\') in the prompt, use '\\'.
If you enter an invalid expression at the prompt, MATLAB displays the relevant error message and then redisplays the prompt.
Request a text response. Assign a default value ('Y') by checking for an empty matrix.
reply = input('Do you want more? Y/N [Y]: ', 's');
if isempty(reply)
reply = 'Y';
endginput | inputdlg | keyboard | menu | uicontrol
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |