MATLAB: Adding quotes to a user input

inputquotesstringswitch

Is it possible to write some code that will add single quotations to a user input to make it into a string so that it can be used in a switch loop, etc.
For example:
method = input('linear or cubic? ');
switch(method)
case 'linear'
disp('Method is linear')
case 'cubic'
disp('Method is cubic')
end
The user here must type in 'linear' or 'cubic', is it possible to make it so they can just type in linear or cubic without quotes.

Best Answer

Try the 's' option.
method = input('linear or cubic? ', 's');