length
並列オブジェクト配列の長さ
説明
例
タスク オブジェクト内のタスク数
ジョブ オブジェクト J
に割り当てられているタスクの数を調べます。
ジョブを作成し、ランダムな数のタスクを割り当てて、10 行 10 列の乱数行列を生成します。
c = parcluster(); % Use default profile j = createJob(c); num_Tasks = randi([1 50],1); for idx = 1:num_Tasks task_idx = createTask(j, @rand, 1, {10,10}); end
タスク j.Tasks
のオブジェクト配列を調べます。
L = length(j.Tasks)
L = 41
入力引数
obj
— オブジェクト配列
オブジェクト | オブジェクト配列
調べるオブジェクト。単一の並列オブジェクトまたは並列オブジェクト配列として指定します。並列オブジェクトは distributed
、codistributed
、gpuArray
、Composite
、parallel.Job
、または parallel.Task
のオブジェクトにすることができます。
例: L = length(distributed(1:10))
バージョン履歴
R2006a より前に導入
参考
distributed
| codistributed
| gpuArray
| Composite
| createJob
| createTask
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)