How do you preallocate an array of FevalFutures?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Walter Roberson
am 23 Okt. 2023
Loop backwards.
clear experiments
for i = 10:-1:1
experiments(i) = parfeval(@magic, 1, 5);
end
experiments
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!