randinit.m
来自「matlab算法集 matlab算法集」· M 代码 · 共 19 行
M
19 行
function randinit (s)
%-----------------------------------------------------------------------
% Usage: randinit (s)
%
% Description: Initialize the random number generator with a seed
%
% Inputs: s = an integer seed which selects a random
% sequence. If seed <= 0, a random seed
% based on the time of day is selected.
%-----------------------------------------------------------------------
if s > 0
rand ('state',s)
else
rand ('state',sum(100*clock))
end
%-----------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?