Variable not found in parfor loop
Mostrar comentarios más antiguos
If I run the script:
z=1:1000;
parfor i=1:numel(z)
zfun(z(i))
end
which calls the function:
function zfun(z)
for j=1:50
for k=1:100
myz=z*10+myz*k;
end
end
save(fullfile('filepath', num2str(myz)), 'myz');
end
I get an error of Undefined function or variable 'myz' for the save command.
Any ideas how to fix this?
2 comentarios
Walter Roberson
el 20 de En. de 2017
Which MATLAB version?
My spidy-senses are suggesting you might be using R2015b or R2016a but not R2016b ?
JohnDylon
el 20 de En. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB 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!