| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Parallel Computing Toolbox |
| Contents | Index |
| Learn more about Parallel Computing Toolbox |
D = distributed.ones(n)
D = distributed.ones(m, n, ...)
D
= distributed.ones([m, n, ...])
D = distributed.ones(..., classname)
D = distributed.ones(n) creates an n-by-n codistributed matrix of ones of class double.
D = distributed.ones(m, n, ...) or D = distributed.ones([m, n, ...]) creates an m-by-n-by-... distributed array of ones.
D = distributed.ones(..., classname) specifies the class of the distributed array D. Valid choices are the same as for the regular ones function: 'double' (the default), 'single', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', and 'uint64'.
Create a 1000-by-1000 distributed matrix of ones of class double:
D = distributed.ones(1000);
ones MATLAB function reference page
codistributed.ones, distributed.eye, distributed.zeros
![]() | distributed.NaN | distributed.rand | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |