Skip to content

input

Prompt the user for input from the console.

user_entry = input(prompt)
user_entry = input(prompt, 's')

Displays prompt and waits for the user to type a response in the console. By default, the response is evaluated as a MathJet expression and returned. With the 's' option, the literal string is returned without evaluation.

n = input('How many? ')
name = input('Your name? ', 's')
  • disp — Display the value of a variable without printing its name.
  • fprintf — Write formatted data to a file or the console.