f



Nested parfor loop: Classification of Matrix inside loop #2

Hello,

I am having problems with the following loop, since it is taking too much time. Hence, I would like to use parallel processing, specifically parfor function.

Can anyone, please, help me to convert the following 'far' loop into 'parfor'?

P = numel(scaleX); %  quite BIG number
sz = P;
start = 1;
sqrL = 10; %  sqr len
e = 200;
A = false(sz, sz);

parfor m = sz-sqrL/2:(-1)*sqrL:start
    for n = M(m):-sqrL:1
        temp = [scaleX(m), scaleY(m); scaleX(n), scaleY(n)];
        d = pdist(temp, 'euclidean');
        if d < e
            A(m, n) = 1;
        end
    end
end

Thank you!
0
Bek
4/14/2015 1:17:41 AM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
3826 Views

Similar Articles

[PageSpeed] 26

Reply: