randn

randn值数组

句法

R = randn(SZ,数组类型
R = randn(SZ,数据类型数组类型

R = randn(SZ, '象',P)
R = randn(SZ,数据类型, '喜欢',P)

C = randn(SZ,codist)
C =兰特(SZ,数据类型,codist)
C = randn(SZ,___,codist, 'noCommunication')
C = randn(SZ,___,codist, '喜欢',P)

描述

R = randn(SZ,数组类型创建一个矩阵与底层类的双,与randn值中的所有元素。

R = randn(SZ,数据类型数组类型创建具有基本类的矩阵数据类型randn值中的所有元素。

的大小和数组的类型是由参数选项根据下表来指定。

争论 说明
SZ ñ 指定大小为ñ-通过-ñ矩阵。
M,N要么[M n]的 指定大小为-通过-ñ矩阵。
M,N,...,K要么[m×n个... k]的 指定大小为-通过-ñ-by -...-逐ķ阵列。
数组类型 '分散式' 指定分布阵列。
'codistributed' 指定codistributed阵列,使用默认的分配方案。
'gpuArray' 指定gpuArray。
数据类型 '双'(默认),'单' 指定底层类的阵列,即,其元素的数据类型。

R = randn(SZ, '象',P)创建的阵列randn与作为阵列相同的类型和底层类(数据类型)值P

R = randn(SZ,数据类型, '喜欢',P)创建的阵列randn与指定的基础类的值(数据类型),以及相同类型的阵列P

C = randn(SZ,codist)要么C =兰特(SZ,数据类型,codist)创建的codistributed阵列randn具有指定大小和基础类(默认值数据类型'双')。该codistributor对象codist指定用于创建codistributed阵列的分配方案。有关构建codistributor对象的信息,请参阅参考页codistributor1dcodistributor2dbc。要使用默认的分配方案,你可以指定的无参数的构造函数codistributor。例如:

SPMD C = randn(8,codistributor1d());结束

C = randn(SZ,___,codist, 'noCommunication')指定不相互工作的通信是构建codistributed阵列时,跳过一些错误检查步骤被执行。

C = randn(SZ,___,codist, '喜欢',P)创建的codistributed阵列randn具有指定大小,底层类,和分配方案的值。如果省略任一类或codistributor参数,该特性从codistributed阵列获取的P

例子

创建分布式Randn矩阵

创建的1000通过-1000分布阵列randn双底层类值:

d = randn(1000,'分散式');

创建Codistributed Randn矩阵

创建的1000按1000 codistributed双矩阵randn值,用它的第二维(列)分布。

SPMD(4)C = randn(1000,'codistributed');结束

有四个工人,每个工人包含1000通过-250的本地片C

创建1000按1000 codistributed矩阵randn值,其列分布。

SPMD(4)codist = codistributor('1D',2100 * [1:numlabs]);C = randn(1000,1000,'单',codist);结束

每个工人包含100逐labindex本地片C

创建gpuArray兰德矩阵

创建的1000按1000 gpuArrayrandn与底层类值

G = randn(1000,'双''gpuArray');

介绍了在R2006b