How do you preallocate an array of FevalFutures?
7 ビュー (過去 30 日間)
古いコメントを表示
I want to run many experiments using parfeval. How can I preallocate an array of the futures? The sample below results in an error saying the constructor needs more arguments.
experiments = parallel.FevalFuture(100)
for i = 1:100
experiments(i) = parfeval(@magic, 1, 5);
end
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 10 月 23 日
Loop backwards.
clear experiments
for i = 10:-1:1
experiments(i) = parfeval(@magic, 1, 5);
end
experiments
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!