time | Calls | line |
---|
| | 1 | function R = randn(s, m, n, varargin)
|
| | 2 | %RANDN Pseudorandom numbers from a standard normal distribution.
|
| | 3 | % R = RANDN(S,N) returns an N-by-N matrix containing pseudorandom values drawn
|
| | 4 | % from the standard normal distribution. RANDN draws those values from the
|
| | 5 | % random stream S. RANDN(S,M,N) or RANDN(S,[M,N]) returns an M-by-N matrix.
|
| | 6 | % RANDN(S,M,N,P,...) or RANDN(S,[M,N,P,...]) returns an M-by-N-by-P-by-...
|
| | 7 | % array. RANDN(S) returns a scalar. RANDN(S,SIZE(A)) returns an array the
|
| | 8 | % same size as A.
|
| | 9 | %
|
| | 10 | % Note: The size inputs M, N, P, ... should be nonnegative integers.
|
| | 11 | % Negative integers are treated as 0.
|
| | 12 | %
|
| | 13 | % R = RANDN(..., 'double') or R = RANDN(..., 'single') returns an array of
|
| | 14 | % normal values of the specified class.
|
| | 15 | %
|
| | 16 | % The sequence of numbers produced by RANDN is determined by the internal
|
| | 17 | % state of the random stream S. RANDN uses one or more uniform values from S
|
| | 18 | % to generate each normal value. Control S using its RESET method and its
|
| | 19 | % properties.
|
| | 20 | %
|
| | 21 | % See also RANDN, RANDSTREAM, RANDSTREAM/RAND, RANDSTREAM/RANDI.
|
| | 22 |
|
| | 23 | % Copyright 2008-2017 The MathWorks, Inc.
|
| | 24 |
|
< 0.001 | 1 | 25 | if nargin < 2
|
| | 26 | R = builtin('_RandStream_randn',s);
|
< 0.001 | 1 | 27 | elseif nargin < 3
|
| | 28 | m = convertStringsToChars(m);
|
| | 29 | R = builtin('_RandStream_randn',s,m);
|
< 0.001 | 1 | 30 | elseif nargin < 4
|
< 0.001 | 1 | 31 | n = convertStringsToChars(n);
|
< 0.001 | 1 | 32 | R = builtin('_RandStream_randn',s,m,n);
|
| | 33 | else
|
| | 34 | [varargin{1:end}] = convertStringsToChars(varargin{1:end});
|
| | 35 | R = builtin('_RandStream_randn',s,m,n,varargin{1:end});
|
< 0.001 | 1 | 36 | end
|