?? randperm.m
字號:
function p = randperm(n);
%P=randperm(n) 生成1,2…,n的一個隨機排列
%
%RANDPERM Random permutation.
% RANDPERM(n) is a random permutation of the integers from 1 to n.
% For example, RANDPERM(6) might be [2 4 5 6 1 3].
%
% Note that RANDPERM calls RAND and therefore changes RAND's
% seed value.
%
% See also PERMUTE.
% Copyright (c) 1984-98 by The MathWorks, Inc.
% $Revision: 5.4 $ $Date: 1997/11/21 23:44:34 $
[ignore,p] = sort(rand(1,n));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -