Let' say I have the code like this:
gcp;
a=zeros(1,3);
my_cell={[1 1 1;2 2 2],[3 3 3;4 4 4],[5 5 5;6 6 6;7 7 7]};
parfor I=1:3
input_data=my_cell{I};
[ result ] = my_function( input_data );
[a,~,~] = union(a,result,'rows');
end
In my code informed this warning: the temporary variable "a" uses a value set outside of the parfor loop. How can I fix this error for "parfor"
Thanks.