Scilab 5.3.0
      
      - Scilab Online Help
- Elementary Functions
- Discrete mathematics
- Floating point
- Integer representation
- Trigonometry
- abs
- amell
- and
- &
- binomial
- bitand
- bitor
- bloc2exp
- bloc2ss
- cat
- cell2mat
- cellstr
- char
- cumprod
- cumsum
- delip
- diag
- diff
- dsearch
- exp
- eye
- flipdim
- gsort
- imag
- imult
- ind2sub
- intersect
- inttrap
- isdef
- isempty
- isequal
- isequalbitwise
- isreal
- isvector
- kron
- lex_sort
- linspace
- log
- log10
- log1p
- log2
- logm
- logspace
- lstsize
- max
- maxi
- meshgrid
- min
- mini
- modulo
- ndgrid
- ndims
- nextpow2
- norm
- ones
- or
- |
- pen2ea
- permute
- pertrans
- prod
- rand
- real
- resize_matrix
- setdiff
- sign
- signm
- size
- solve
- sort
- sqrt
- sqrtm
- squarewave
- ssrand
- sub2ind
- sum
- sysconv
- sysdiag
- syslin
- toeplitz
- trfmod
- trianfml
- tril
- trisolve
- triu
- typeof
- union
- unique
- vectorfind
- zeros
Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
rand
乱数生成
呼び出し手順
rand(m1,m2,.. [,key]) rand(x [, key]) rand() rand(key) rand("seed" [,n]) rand("info")
パラメータ
- mi
- 整数 
- key
- "uniform",- "normal"を値とする文字列
- x
- 行列. その次元のみが処理されます. 
説明
乱数生成器.
key 引数を省略すると, 以下の構文はカレントの乱数生成器(デフォルトは "uniform")により 乱数行列を生成します.
- rand(m1,m2)
- は, 次元が - m1行- m2列の乱数行列です.
- rand(m1,m2,..,mn)
- は,次元が - m1x- m2,.. x- mnの乱数行列です.
- rand(a)
- はaと同じ大きさの乱数行列です. - aが複素数行列の場合,- rand(a)は複素数です.
- rand() : 引数を指定しない場合, 値が変化するスカラー値となります
- 参照される度に. 
key引数が指定された場合, その他の乱数分布を指定することができるように なります.
- rand('uniform')
- カレントの乱数生成器が一様分布の乱数生成器に 設定されます.乱数は(0,1)の範囲の一様分布となります. 
- rand('normal')
- カレントの乱数生成器はガウス乱数生成器(平均0,分散1)に設定されます. 
- str=rand('info')
- デフォルトの乱数生成器の型('uniform' または 'normal')を返します. 
乱数生成器のシードを(再)初期化することが可能です:
- rand('seed')
- シードのカレントの値を返します. 
- rand('seed',n)
- シードを - nに設定します. (デフォルトでは, 最初のコールで- n=0).
注意
代わりにより強力な関数 grand を使用してください.
例
x=rand(10,10,'uniform') rand('normal') rand('info') y=rand(x,'normal'); x=rand(2,2,2)
| << prod | Elementary Functions | real >> |