parallel computing problem in subfuction

1 visualización (últimos 30 días)
lv
lv el 17 de Nov. de 2014
Editada: lv el 17 de Nov. de 2014
I have this simple parfor code
Ne = round((E0max - E0min)/dE0);
parfor count =1:Ne
[etap, etaNzrp(count)] = shooting(E0min+(count-1)*dE0);
end
when I run in for loop, it looks just fine. But this parfor loop report an error in subfunc shooting.
function [eta, etaNz] = shooting(E)
% Shooting method
global m Eref Unef Egw bwbwbwb Egb dz Angstrom Nz hbar U e
% Conduction band nonparabolicity
mn = m .* ((1 + (E - Eref - Unef) / Egw) .* (bwbwbwb == 0) + (1 + (E - Eref - Unef) / Egb) .* (bwbwbwb == 1));
if (min(mn) <= 0)
disp('Error! Mass is negative!')
return
end
eta = zeros(1, Nz);
eta(2) = eps * dz * Angstrom;
...
...
the error appear in 'eta(2) = eps * dz * Angstrom;'
In an assignment A(I) = B, the number of elements in B and I must be the same.
How to fix it?

Respuestas (0)

Categorías

Más información sobre Parallel Computing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by