网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 知识问答

matlab的rng函数的用法

时间:2024-10-12 16:18:31

1、首先来看matlab的帮助文档,第一行Control random number generation(控制随机数的生成,不知道这么翻译对不对,接着看)Syntax(句法的意思),介绍了几种常用的调用方式

matlab的rng函数的用法

2、rng(seed)seeds the random number generator using the nonnegative integerseedso thatrand,randi, andrandnproduce a predictable sequence of numbers.(rng(种子)种子使用非负整数种子种子,使rand、randi和randn产生一个可预测的数字序列。)rng('shuffle')seeds the random number generator based on the current time. Thus,rand,randi, andrandnproduce a different sequence of numbers after each time you callrng.(rng('shuffle')种子基于当前时间生成随机数生成器。因此,兰德、randi和兰德在每次调用rng之后都会产生不同的数字序列。)此处可以理解,因为电脑的随机数并不是像掷骰子一样和现实中一样随机,接着看

matlab的rng函数的用法

3、这一段就不翻译了,这里就可以看出电脑的随机数是利用了一些算法生成的,这里列出了七种算法

matlab的rng函数的用法

4、后面还有一部分也不翻译了,自己看很容易理解的

© 2026 阿力知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com