haibaraxx的个人博客分享 http://blog.sciencenet.cn/u/haibaraxx

博文

Matlab: create uniformly distributed random numbers

已有 2283 次阅读 2016-3-8 05:27 |个人分类:Matlab|系统分类:科研笔记| Random, create, distributed, numbers, uniformly

% The uniformly distributed random numbers are in the interval (0,1).

X1 = rand;     % retun a singal ramdom number.
X2 = rand(6);     % return a 6-by-6 matrix of random numbers.
X3 = rand(3,4);     % return a 3-by-4 matrix of random numbers.
X4 = -5 + (5+5)*rand(10,1);     % generate a 10-by-1 column vector in (-5,5).

sz = size(X4);     % return the size of the vector X4.




https://blog.sciencenet.cn/blog-3031432-961151.html

上一篇:Matlab: list variables in the workspace
下一篇:IOCCG report reading notes: 6. Ocean-Color Data Merging
收藏 IP: 134.1.1.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-30 00:40

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部