"Index exceeds matrix dimensions" error when using parfor
Mostrar comentarios más antiguos
I am using Matlab R2013a 64-bit. I am getting an "Index exceeds matrix dimensions" error when using parfor. The following is a minimal code that produces this error.
matlabpool open 4
nbig = 200;
nsmall = 100;
x = rand(3,nsmall);
parfor n = 1:nbig
if (n <= nsmall)
a = x(:,n);
else
a = zeros(3,1);
end
end
matlabpool close
I am wondering why this happens. Thanks.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Parallel for-Loops (parfor) en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!