Debian Codegraph @

contrib/ms-sbvar/TZcode/MatlabFiles/fn_reset_ini_seed.m

raw
1 function fn_reset_ini_seed(seednumber)
2 %fn_reset_ini_seed(seednumber)
3 %
4 % After Matlab starts, run this function to reset the seed number; otherwise, Matlab automatically resets to the same initial seed.
5 % seednumber: 0 -- random state reset to the clock time;
6 %
7 % Copyright (C) 1997-2012 Tao Zha
8 %
9 % This free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
13 %
14 % It is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
18 %
19 % If you did not received a copy of the GNU General Public License
20 % with this software, see <http://www.gnu.org/licenses/>.
21 %
22
23 if seednumber
24 randn('state',seednumber);
25 rand('state',seednumber);
26 else
27 randn('state',fix(100*sum(clock)));
28 rand('state',fix(100*sum(clock)));
29 end