clear, clc
str = input('Enter a text: ', 's');
sep = input('Enter separator: ', 's');
 
if isempty(sep)    % treats all cases when sep = '' / ' '
    sep = ' ';
    fprintf('space ('' '') is used instead of nothing');
end
 
words   = cell(1, 1); % allocation
nVowels = zeros(1, 1); % allocation
here    = 1;
while ~isempty(str)
    [token, str]   = strtok(str, sep);
    words{here}    = token;
    nVowels(here)  = length(regexp(token, '[aeiyou]'));
    here           = here + 1;
end
celldisp(words);
fprintf('%s\n', mat2str(nVowels));
