How can i remove matlabpool('open',2) with parpool?
Mostrar comentarios más antiguos
Hello everybody,
I have MATLAB R2015b and I try to replicate a given code, but it does not work since the command matlabpool has been removed and I am not familiar with the suggest parpool command. How can I rewrite the code so that it will work? Thank you all for your help!
This is my code:
format short
matlabpool('open',2);
qe=[0.90;0.95;0.99];
tic;
m=2000;
T=200;
swindow0=40;
r0=swindow0/T;
dim=T-swindow0+1;
y=DGP(T,m);
gsadf=ones(m,1);
parfor j=1:m;
sadfs=zeros(dim,1);
for r2=swindow0:1:T;
dim0=r2-swindow0+1;
rwadft=zeros(dim0,1);
for r1=1:1:dim0;
rwadft(r1)= ADF_FL(y(r1:r2,j),0,1); % two tail 5% significant level
end;
sadfs(r2-swindow0+1)=max(rwadft);
end;
gsadf(j)=max(sadfs);
end;
toc;
matlabpool('close');
quantile_gsadf=quantile(gsadf,qe);
filename = 'CV_GSADF_200_02.xlsx';
xlswrite(filename,gsadf,1,'A1:A2000');
disp([qe quantile_gsadf]);
Respuestas (2)
Walter Roberson
el 25 de Abr. de 2016
p = parpool('local', 2);
and then later
delete(p);
eugenio bedeschi
el 15 de Abr. de 2018
0 votos
Hello, I'm a beginner, experiencing the same problem: I replaced """matlabpool('open',2); and matlabpool('close');""" with """p = parpool('local', 2); and delete(p);""" but now the code stops at y=DGP(T,m); : mathlab tells me it's undefined, I've searched the internet, but no answer. Can you help me?
Thank you
Categorías
Más información sobre Parallel Computing Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!