parallel computing // how to use parfor

1 ビュー (過去 30 日間)
kyoung won Min
kyoung won Min 2020 年 12 月 3 日
回答済み: Pranav Verma 2020 年 12 月 11 日
My code is as below. But error occurs.
("Solve Variable Classification Issues in parfor-Loops" )
I don't know why error occur.
How to solve it??
%% definition of variables
nov = 30 ;
nov_down = -512 ;
nov_up = 512 ;
iter = 5000 ;
nohm = 4 ;
HMCR_down = 0.8 ;
HMCR_up = 1 ;
PAR_down = 0.2 ;
PAR_up = 0.4 ;
bw_down = 0.01 ;
bw_up = 1 ;
runn = 1 ;
HMS = 15 ;
initial=xlsread('HMS15,nov30,-512,512.xlsx');
HM=zeros(nohm,HMS,nov);
parfor i = 1:nohm
HMCR(i) = round(HMCR_down + (HMCR_up-HMCR_down)*rand,2) ;
PAR(i) = round(PAR_down + (PAR_up-PAR_down)*rand,2) ;
bw(i) = round(bw_down + (bw_up-bw_down)*rand,2) ; ;
virtual=zeros(HMS,nov);
virtual(1:HMS,1:nov)=initial;
HM(i,1:HMS,1:nov)= virtual ;
end

回答 (1 件)

Pranav Verma
Pranav Verma 2020 年 12 月 11 日
Hi kyoung,
Please provide with error and your .xls file so that we can reproduce the error.
In the meanwhile, you can go through the Problem with parfor classified variable and see if it helps.
Thanks

Community Treasure Hunt

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

Start Hunting!

Translated by