MATLAB: How to make a function that decides whether a word starts with a vowel

vowel

vowel = [a e i o u];
starts = vowel==1;
function [string] = vowel(input)
if starts == 1
print 'this word starts with a vowel'
end

Best Answer

function y=vowel(input)
if regexp(input,'\<[aeiou | AEIOU]')==1
fprintf('This word starts with a vowel\n');
y=true;
else
fprintf('This word does not start with a vowel\n');
y=false;
end
end
Related Question