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?
4 views (last 30 days)
Show older comments
GEORGE WAYNE MWANGI
on 14 May 2017
Commented: GEORGE WAYNE MWANGI
on 15 May 2017
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'.
8 Comments
Accepted Answer
Jan
on 14 May 2017
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Adding custom doc in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!