%% Elements Satisfying a Condition
% Find the first five elements that are less than 10 in a 4-by-4 magic square matrix.

X = magic(4)

%

k = find(X<10,5)

%
% View the corresponding elements of X.

X(k)

% Copyright 2015 The MathWorks, Inc.