how can i assign multiple output from a function using parfor?
4 ビュー (過去 30 日間)
古いコメントを表示
My function is generating 3-dimentional 5 variable. for montecarlo run i have to generate that 100 times. how can i use parfor that ?or do i have to use some other command?
0 件のコメント
回答 (2 件)
Walter Roberson
2015 年 5 月 25 日
You should be able to use parfor for it.
maxtrial = 100;
results = cell(maxtrial,1);
parfor trialnum = 1 : maxtrial
generate first variable
generate second variable
generate third variable
generate fourth variable
generate fifth variable
calculate outputs with those variables
results{K} = outputs;
end
If the result is a single numeric value then use a numeric array instead of a cell array.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!