Matlab parfor错误:parfor中的变量V_final无法分类

时间:2015-12-19 19:54:48

标签: matlab variables parfor

我有以下简单的MATLAB代码:

B = integer; % Doesn't change
n = integer; % Doesn't change
X = vector; % Doesn't change
Y = vector; % Doesn't change
V_final = zeros(m,4);
residuals_final = zeros(m,1);
parfor q = 1:m
[V_low residuals_low] = customfunction(B, n, X, Y); % function contains loop of n iterations
% V_low is a 2x2 matrix, residuals_low is a floating point number
V_final(q,1) = V_low(1,1);
V_final(q,2) = V_low(1,2);
V_final(q,3) = V_low(2,1);
V_final(q,4) = V_low(2,2);
residuals_final(q) = residuals_low;
end

但得到错误:parfor中的变量V_final无法分类。 每次迭代都是相互独立的,我已经预先分配了我认为需要的一切。任何帮助赞赏。看过文档(很难与这种情况联系起来,除了以为我做了正确的事情)和其他类似问题的答案,或者不一样或者看不出相似之处。

0 个答案:

没有答案