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

    %% Replace Elements of Matrix  

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

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

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