필터 지우기
필터 지우기

Using the parfor loop to minimize a function

조회 수: 1 (최근 30일)
george pepper
george pepper 2020년 4월 30일
Hello,
I am completely new to MATLAB's parallel computing and I didn't know how to convert my for loop into a parfor loop. I have a function f which I would like to evaluate at 10000 different values in vector A. My laptop has 6 processors that I would like to use simultaneously to divide the task because evaluating my function is very time-consuming. So, here is how my simplified problem looks like:
A=[]; %a 10 by 6 matrix of parameter values
eval=zeros(10000,1;)
for t=1:10000
eval(t)=f(A(t,:));
end
Can you help me rewrite this for a parfor loop?
Thanks in advance!
George

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by