I'm completely stumped by my inability to use parfor for a simple problem. I've boiled it down to a ridiculous case. Can someone please explain?
function b=wtf(a)sz = size(a);b=a;parfor x=1:sz(1) for y=1:sz(2) b(x,y) = 5; endend
Calling this results in an error:
>> wtf(zeros(3))Error: File: wtf.m Line: 8 Column: 9The variable b in a parfor cannot be classified.See Parallel for Loops in MATLAB, "Overview".
Is it actually not possible to use parfor when the size of the input is not absolutely fixed ahead of time?
Best Answer