Hi, I'm starting to use "parfor" in my MATLAB scripts.
In this simple example, for each iteration, I get a 2D 'sub_matrix' from a 2D big matrix (image).
But I got this warning message: "the entire array is a broadcast variable. This might result in unnecessary communication overhead.
% For each pixel in the 'image':
parfor row = 1:N for col = 1:M % Crop a sub matrix from the original image:
sub_image = image(row:row+H-1, col:col+W-1); % WARNING HERE!
% Do other stuffs...
endend
How can I modify this code to avoid this communication overhead?
Best Answer