📄 randint.m
字号:
% randInt - create random integers.%% r = randInt(N);% returns a random uniformly distributed integer 1 <= r <= N.%% r = randInt([M N]);% returns a random uniformly distributed integer M <= r <= N.%% r = randInt(M,sz) and r = randInt([M N],sz)% returns an array of size sz with random integers.%% If sz is a scalar, a square array of size [sz sz] is returned.% This file is part of the SaliencyToolbox - Copyright (C) 2006-2007% by Dirk B. Walther and the California Institute of Technology.% See the enclosed LICENSE.TXT document for the license agreement. % More information about this project is available at: % http://www.saliencytoolbox.netfunction r = randInt(arg,varargin)if (isempty(varargin)) sz = 1;else sz = varargin{1};endif (length(arg) < 2) m = 1; n = arg(1);else m = arg(1); n = arg(2);endr = floor(rand(sz)*(n-m+1) + m);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -