Compare first letter of strings in Matlab -


i see if letter inputted user matches of words in dictionary.

could please me this? thank you!

words = {'apple', 'banana', 'bee', 'salad', 'corn', 'elephant', 'pterodactyl'};  user_letter_input = input('please enter first letter of word: ');  = words     if (i starts user_letter_input)         disp(['your new word is: ' i]);     end end 

you can use:

if(i{1}(1) == user_letter_input) 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -