%% Sort Rows of Cell Array
% Create a 6-by-2 cell array of character vectors, and sort its rows. The result is an alphabetized list sorted by both country and name.

A = {'Germany' 'Lukas'; 'USA' 'William'; 'USA' 'Andrew'; ...
'Germany' 'Andreas'; 'USA' 'Olivia'; 'Germany' 'Julia'} 

%

B = sortrows(A)

%
% Sort the countries first, then sort the names in descending order.

C = sortrows(A,[1 2],{'ascend' 'descend'})

% Copyright 2012 The MathWorks, Inc.