parallel_function error, "V must be a 3-D array"
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all, I'm trying to parallelize some of my code, and I have no idea how to fix this error. Here's the code:
energy=zeros(length(epsilon_theta),length(epsilon_r));
Emag=zeros(length(epsilon_theta),length(epsilon_r),21);
parfor m=1:length(epsilon_theta)
energy1=zeros(length(epsilon_r));
Emag1=zeros(length(epsilon_r),21);
for n=1:length(epsilon_r)
[energyf, Emagf, Source_Emag]=DDA_ExpRf_fun([epsilon_theta(m) epsilon_r(n)]);
energy1(n)=energyf;
Emag1(n,:)=Emagf;
end
energy(m,:)=energy1;
Emag(m,:,:)=Emag1;
end
When I run it, parfor breaks and returns
??? Error using ==> parallel_function at 598 Error in ==> interp3>linear at 320 V must be a 3-D array.
Does anyone know what could be the problem? Thanks! I'm totally new to parallel computing. Any other general tips on optimizing would be great as well.
1 Commento
Edric Ellis
il 9 Mar 2012
Do thinks work correctly with MATLABPOOL closed? Do they work correctly with a FOR loop instead of a PARFOR loop? I presume your code in DDA_ExpRf_fun is calling interp3 - perhaps you should add some error checking that your variables are the correct size when you get there.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!