matlab randint,Matlab的randint函数用法「建议收藏」

RANDINTGeneratematrixofuniformlydistributedrandomintegers.OUT=RANDINTgeneratesa”0″or”1″withequalprobability.OUT=RANDINT(M)generatesanM-by-Mmatrixofrandombinarynumbers.”0″an…

大家好,又见面了,我是你们的朋友全栈君。

RANDINT Generate matrix of uniformly distributed random integers.

OUT = RANDINT generates a “0” or “1” with equal probability.

OUT = RANDINT(M) generates an M-by-M matrix of random binary numbers.

“0” and “1” occur with equal probability.

OUT = RANDINT(M,N) generates an M-by-N matrix of random binary numbers.

“0” and “1” occur with equal probability.

OUT = RANDINT(M,N,IRANGE) generates an M-by-N matrix of random integers.

IRANGE can be either a scalar or a two-element vector:

Scalar : If IRANGE is a positive integer, then the output integer

range is [0, IRANGE-1].  If IRANGE is a negative integer,

then the output integer range is [IRANGE+1, 0].

Vector : If IRANGE is a two-element vector, then the output

integer range is [IRANGE(1), IRANGE(2)].

OUT = RANDINT(M,N,IRANGE,STATE) causes RAND to use the generator

determined by the ‘state’ method, and initializes the state of that

generator using the value of STATE.

Examples:

out = randint(2,3)                 out = randint(2,3,4)

out =                              out =

0     0     1                      1     0     3

1     0     1                      2     3     1

out = randint(2,3,-4)              out = randint(2,3,[-2 2])

out =                              out =

-3    -1    -2                     -1     0    -2

-2     0     0                      1     2     1

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/127601.html原文链接:https://javaforall.net

(0)
上一篇 2022年4月10日 上午9:40
下一篇 2022年4月10日 上午10:00


相关推荐

  • 国产的FPGA_能不能长点心

    国产的FPGA_能不能长点心关注、星标公众号,直达精彩内容FPGA作为嵌入式必备的一个硬件,国产的产品也正在逐渐渗透工程师的生活之中。不过tzgok认为,目前国产FPGA还有几个问题非常令人困扰,并发出评论表示“国产…

    2025年11月11日
    8
  • 命令行连接mongodb_yum安装mongodb

    命令行连接mongodb_yum安装mongodb情况:1.使用xmanage能远程链接centos

    2022年8月21日
    8
  • idea激活码 在线(注册激活)[通俗易懂]

    (idea激活码 在线)本文适用于JetBrains家族所有ide,包括IntelliJidea,phpstorm,webstorm,pycharm,datagrip等。IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html…

    2022年3月30日
    129
  • Zulu智能体

    Zulu智能体

    2026年3月16日
    8
  • Linux安装anaconda3是否初始化的区别「建议收藏」

    Linux安装anaconda3提示是否希望安装程序通过运行condainit来初始化Anaconda3?DoyouwishtheinstallertoinitializeAnaconda3byrunningcondainit?官方建议的是选yes,那么选择yes和no有什么区别呢?1、选择yes:选择yes的话,bashrc文件中会添加以下内容,这样在打开终端时自…

    2022年4月15日
    312
  • RSA算法详解及C语言实现

    RSA算法详解及C语言实现1 什么是 RSARSA 公钥加密算法是 1977 年由罗纳德 李维斯特 RonRivest 阿迪 萨莫尔 AdiShamir 和伦纳德 阿德曼 LeonardAdlem 一起提出的 1987 年首次公布 当时他们三人都在麻省理工学院工作 RSA 就是他们三人姓氏开头字母拼在一起组成的 RSA 是目前最有影响力的公钥加密算法 它能够抵抗到目前为止已知的绝大多数密码攻击 已被 ISO 推荐为公钥数

    2026年3月18日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号