MATLAB: Hi everyone.I need help. I am trying to write a set of input statements that prompt the user for his/her favorite band, favorite song, favorite restaurant, and favorite food but i keep getting the same error message. What could be the problem

#errormessage

favoriteband= input ('Please enter your favorite band:','s');
favoritesong= input ('\n Please enter your favorite song:','s');
favoriterestaurant= input('\n Please enter your favorite restaurant:','s');
favoritefood= input('\n Please enter your favorite food:','s');
Undefined function or method 'question' for input arguments of type 'char'.

Best Answer

How do you start the shown code? Is it stored in a script or function file called "question.m"? Then this file might not be in one of the folders contain in Matlab's path. Store it in a user defined folder than and attach this folder to the path - see:
doc addpath
Or perhaps you wanted to store the code in such a file but have a typo in the file name.
But these are bold guesses only. This would not explain, why Matlab searchs for a function with a char as first input. This will get clear, if you post the complete code and explain, how you start it.
Related Question