Creating some fake data and and implementing a simple LOSS function, I do
not see a different between the serial and parallel execution. Does LOSS
use any persistent or global variables?
function [ rssi rssi2 ] = foo
APLocation = rand(10);
RXpoint = rand(10) * 5;
for i=1:size(APLocation,1)
point=APLocation(i,:);
parfor j=1:length (RXpoint)
rssi(i,j) = LOSS(point,RXpoint(:,j)');
end
end
for i=1:size(APLocation,1)
point=APLocation(i,:);
for j=1:length (RXpoint)
rssi2(i,j) = LOSS(point,RXpoint(:,j)');
end
end
end
function rv = LOSS( a,b )
rv = sum( a+b );
end
"michael" <bezenchu@gmail.com> wrote in message
news:ht0t0k$fce$1@fred.mathworks.com...
> for i=1:size(APLocation,1)
> point=APLocation(i,:);
> parfor j=1:length (RXpoint)
> rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal
> strength from all AP's
> end
> end
>
> when i'm running the following code, i get the same value for each element
> of rssi (serially i get different results)
>
>
> where is my problem?
>
