%% Test Vector Elements
% Find which vector elements are greater than or equal to a given value.
% Create a numeric vector.

A = [1 12 18 7 9 11 2 15];

%
% Test the vector for elements that are greater than or equal to 11.

A >= 11

% The result is a vector with values of logical 1 (true) where the elements of A satisfy the expression.
%
% Use the vector of logical values as an index to view the values in A that are greater than or equal to 11.

A(A >= 11)

% The result is a subset of the elements in A.
% Copyright 2012 The MathWorks, Inc.