www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ReplaceElementsOfMatrixLessThanOrEqualExample.m

    %% Replace Elements of Matrix  

%% 
% Create a matrix. 
A = magic(4)  

%% 
% Replace all values less than or equal to |9| with the value |10|. 
A(A <= 9) = 10 

%%
% The result is a new matrix whose smallest element is |10|.