%% Replace Elements of Matrix
% Create a matrix.

A = magic(4)

%
% Replace all values greater than 9 with the value 10.

A(A > 9) = 10

% The result is a new matrix whose largest element is 10.
% Copyright 2012 The MathWorks, Inc.