I want to replace the vowels AEIOU with the number 0 and all other letters with the number 1. For example the output should be ans = [0 1 1 1 0] if the user inputs apple. I know I must be misunderstanding how to get the loop to go through my whole string. This is what I have managed so far.
party = input('What is your answer? ', 's');n = length(party)for i = 1:n if i == 'A' disp(0) elseif i == 'B' disp(1) elseif i == 'C' disp(1) endend
Best Answer