%% Sorted Matrix Rows
% Create a 5-by-5 matrix and check if each row is sorted in descending order.

A = magic(5)

%

issorted(A,2,'descend')

%
% Sort each row of A in descending order using the sort function, and check that the result has descending rows.

B = sort(A,2,'descend')

%

issorted(B,2,'descend')

% Copyright 2012 The MathWorks, Inc.