randint.m

来自「显著区域检测。求的图像中感兴趣区域的位置」· M 代码 · 共 38 行

M
38
字号
% 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 + =
减小字号Ctrl + -
显示快捷键?