Question: I think that the variable A below is a sliced variable but I am unsure how I am violating parfor restrictions – is there any way I can parallelize this?
I receive the error: `Error: The variable A in a parfor cannot be classified.' when I run the following:
parfor j = 1:J for t = 1:T A(t+1,j) = interp1(x,V(:,b(t),j),A(t,j),'linear'); endend
A minimum working example setup just before I invoke the parfor command is:
J = 5;T = 310000;A = zeros(310001,5); A(1,:) = ones(1,5);x = (0.01:0.01:10);V = repmat(x',[1 3 5]); % V is 1000x3x5
rng('default');b = randi([1 3],310001,1);
Best Answer