Main Content

为GPU或分布式数组创建所有零的数组

描述

例子

z= zeros(n,,,,arrayType返回ann-by-n矩阵具有基础类别的双重零,所有元素中的零,以及由arrayType

z= zeros(Size1,...,Sizen,,,,arrayType返回asize1-by -....- by-西森矩阵具有基础类别的双重零,所有元素中的零,以及由arrayType

z= zeros(尺寸,,,,arrayType返回anarray whose size is defined by the size vector尺寸底层阶级的翻倍,在所有elem 0ents, and the type specified byarrayType

例子

z= zeros(n,,,,数据类型,,,,arrayType返回ann-by-n矩阵与基础类别数据类型,,,,零in all elements, and the type specified byarrayType

z= zeros(Size1,...,Sizen,,,,数据类型,,,,arrayType返回asize1-by -....- by-西森矩阵与基础类别数据类型,,,,零in all elements, and the type specified byarrayType

z= zeros(尺寸,,,,数据类型,,,,arrayType返回anarray whose size is defined by the size vector尺寸with underlying class of数据类型,,,,零in all elements, and the type specified byarrayType

z= zeros(n,,,,'like',p返回ann-by-n与原型数组相同的基础类和类型的零数组p

z= zeros(Size1,...,Sizen,,,,'like',p返回asize1-by -....- by-西森与原型数组相同的基础类和类型的零数组p

z= zeros(尺寸,,,,'like',p返回anarray of zeros whose size is defined by the size vector尺寸with the same underlying class and type as the prototype array,p

z= zeros(n,,,,数据类型,,,,'like',p返回ann-by-n带有基础类的数组数据类型,所有元素中的零,与原型数组相同的类型,p

z= zeros(Size1,...,Sizen,,,,数据类型,,,,'like',p返回asize1-by -....- by-西森带有基础类的数组数据类型,所有元素中的零,与原型数组相同的类型,p

z= zeros(尺寸,,,,数据类型,,,,'like',p返回anarray whose size is defined by the size vector尺寸with underlying class of数据类型,所有元素中的零,与原型数组相同的类型,p

C= zeros(n,,,,编码师返回ann-by-n在各个元素中,与基础的double和Zeros类别进行编码数组。Codistributor对象编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

C= zeros(Size1,...,Sizen,,,,编码师返回asize1-by -....- by-西森在各个元素中,与基础的double和Zeros类别进行编码数组。Codistributor对象编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

C= zeros(尺寸,,,,编码师返回acodistribed阵列whose size is defined by the size vector尺寸with underlying class of double and zeros in all elements. The codistributor object编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

C= zeros(n,,,,数据类型,,,,编码师返回ann-by-n与基础类别的编码阵列数据类型和各个元素的零。Codistributor对象编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

例子

C= zeros(Size1,...,Sizen,,,,数据类型,,,,编码师返回asize1-by -....- by-西森与基础类别的编码阵列数据类型和各个元素的零。Codistributor对象编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

C= zeros(尺寸,,,,数据类型,,,,编码师返回acodistribed阵列whose size is defined by the size vector尺寸with underlying class of数据类型和各个元素的零。Codistributor对象编码师指定用于创建编码阵列的分发方案。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc

C= zeros(___,编号师,“ Nocommunication”)specifies that no interworker communication is to be performed when constructing a codistributed array, skipping some error checking steps.

C= zeros(___,,,,编码师,,,,'like',P)使用指定的大小,基础类和分配方案创建一个编码的零数组。如果省略了类或codistributor参数,则从codistribed数组中获取特征p

例子

全部收缩

创建一个带有基础类double的零的1000 x-1000分布式阵列。

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

创建一个1000 x-1000的编码零矩阵,由其第二维(列)分发。

SPMD(4) C = zeros(1000,'codistributed');结尾

每个工人都有四名工人,其中包含1000 x-250的本地部分C

创建一个1000 x-1000的codistribedUINT16matrix of zeros, distributed by its columns.

SPMD(4) codist = codistributor('1d',,,,2,100*[1:numlabs]); C = zeros(1000,1000,'uint16',编码师);结尾

每个工人都包含一个100乘Labindex本地C

Create a 1000-by-1000 gpuArray of zeros, with underlying classUINT32

g =零(1000,'uint32',,,,'gpuArray');

输入参数

全部收缩

生成数组的大小,指定为整数值。

Size of each dimension of the generated array, specified as separate arguments of two or more integer values.

每个维度的大小,指定为整数值的行向量。该向量的每个元素指示相应维度的大小。

生成的数组的类型,指定为'分散式',,,,'codistributed', 或者'gpuArray'

数组的基础类是其元素的数据类型,被指定为以下选项之一:

  • '双倍的'

  • '单身的'

  • 'int8'

  • 'uint8'

  • 'int16'

  • 'uint16'

  • 'int32'

  • 'uint32'

  • 'int64'

  • 'uint64'

用于创建编码阵列的分发方案,指定为Codistributor对象。有关构建Codistributor对象的信息,请参阅参考页面编码师ributor1dand编码师ributor2dbc。To use the default distribution scheme, you can specify a codistributor constructor without arguments.

prototype of array to create, specified as an array.

输出参数

全部收缩

Array of zeros, returned as either a distributed array, a codistributed array, or a gpuArray.

零数组,作为一个编码阵列返回。

也可以看看

|||||

在R2006b中引入