MATLAB PARALLEL COMPUTING TOOLBOX - S Guía de usuario Pagina 608

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 656
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 607
11 Functions — Alphabetical List
11-264
Examples
Create Distributed Randi Matrix
Create a 1000-by-1000 distributed array of randi values from 1 to 100, with underlying
class double:
D = randi(100,1000,'distributed');
Create Codistributed Randi Matrix
Create a 1000-by-1000 codistributed double matrix of randi values from 0 to 12,
distributed by its second dimension (columns).
spmd(4)
C = randi([0 12],1000,'codistributed');
end
With four workers, each worker contains a 1000-by-250 local piece of C.
Create a 1000-by-1000 codistributed single matrix of randi values from 1 to 4,
distributed by its columns.
spmd(4)
codist = codistributor('1d',2,100*[1:numlabs]);
C = randi(4,1000,1000,'single',codist);
end
Each worker contains a 100-by-labindex local piece of C.
Create gpuArray Randi Matrix
Create a 1000-by-1000 gpuArray of randi values from —50 to 50, with underlying class
double:
G = randi([-50 50],1000,'double','gpuArray');
See Also
randi | rand | randn
Vista de pagina 607
1 2 ... 603 604 605 606 607 608 609 610 611 612 613 ... 655 656

Comentarios a estos manuales

Sin comentarios