%% Construct Unique Character Vectors
% Create a cell array of names and make each element unique.

S = {'John' 'Sue' 'Nick' 'John' 'Campion' 'John' 'Jason'};
U = matlab.lang.makeUniqueStrings(S)

% The makeUniqueStrings function appends the duplicate names in elements 3 and 5 with underscores and incrementing numbers.
% Copyright 2012 The MathWorks, Inc.