%% Sort Names into Alphabetical Groups
% Create names as a string. Use characterListPattern to create a pattern that matches characters A through G. Find names that start with A through G using startsWith. Repeat this process for H through P and Q through Z.

names = ["Andres" "Betty" "Chris" "David" "Etsuko" "Fredrick"...
        "Gaston" "Hasina" "Ian" "Jose" "Karen" "Larry" "Malia"...
        "Nick" "Omar" "Patrick" "Quincy" "Rajesh" "Shruti"...
        "Tau" "Uma" "Veronica" "Wendy" "Xiao"...
        "Yakov" "Zhanna"];
    
NameGroup1 = names(startsWith(names,characterListPattern('A','G')))    
NameGroup2 = names(startsWith(names,characterListPattern('H','P')))    
NameGroup3 = names(startsWith(names,characterListPattern('Q','Z')))

% Copyright 2020 The MathWorks, Inc.