[QUOTE]input得到的是字符[/QUOTE]
首先应该查看input的help而不是信口开河
INPUT Prompt for user input.
R = INPUT('How many apples') gives the user the prompt in the
text string and then waits for input from the keyboard.
The input can be any MATLAB expression, which is evaluated,
using the variables in the current workspace, and the result
returned in R. If the user presses the return key without
entering anything, INPUT returns an empty matrix.
R = INPUT('What is your name','s') gives the prompt in the text
string and waits for character string input. The typed input
is not evaluated; the characters are simply returned as a
MATLAB string.
The text string for the prompt may contain one or more '\n'.
The '\n' means skip to the beginning of the next line. This
allows the prompt string to span several lines. To output
just a '\' use '\\'.
See also KEYBOARD.
默认情况下input返回的是double的matrix
如果要返回string类型,可以用
s = input('input your option','s');