Output function
The input function allows you to ask a user to type some sort of information into the program and to save that information into a variable that the program can process.
The Input Function
The input function is used to ask the user of the program (not the programmer) a question and then wait for a typed response. The typed number is then returned as the result of the function and should usually be stored in a variable:
Reading Strings
By default, the input function expects to read a number, and if the user types hello, it will assume that hello is a variable containing a number. If you really want the string "hello," then you would have to type 'hello' (tick marks).
To tell a Matlab program to read a string of characters directly without having to type the tick marks, you must use the 's' syntax as shown here:
The input function is similar (but more user friendly) to the scanf function in C. Thus, in C, if you wish to receive input from the user of the program, you must use the scanf (or fgets) function.