Getting different answers when using mldivide in parfor-loop compared to in "ordinary" script
이전 댓글 표시
I am getting different answers for x and xp in the following code:
format long;
n = 1000;
A = rand(n);
b = ones(n,1);
x = A\b;
xp = cell(4,1);
matlabpool open local 4
parfor i=1:4,
xp{i} = A\b;
end
h = @(y) norm(x-y,1);
disp(cellfun(h,xp(:)));
matlabpool close
.
An example of output at my computer is
1.0e-09 *
0.189364648202524
0.189364648202524
0.189364648202524
0.189364648202524
.
I am running Matlab 2011b with PCT version 5.2 on a 64 bit installation of Ubuntu Oneric.
The differences disappear when I start Matlab with "-singleCompThread".
Does anyone have an explanation for this behaviour?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!