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

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

% Copyright 2015 The MathWorks, Inc.

X = magic(4)

%%
%
k = find(X<10,5)

%%
% View the corresponding elements of |X|.
X(k)