Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: parfor error with valiable definition
Posted:
Jul 7, 2014 3:11 AM


Lyly_be <be_aware1989@yahoo.com> writes:
> Hi every body, I have a problem regrading "parfor "command in Matlab. > The error is : Error: The variable para in a parfor cannot be > classified. See Parallel for Loops in MATLAB, "Overview". > > My program details is: I have parfor in a for loop and the parfor > itself consists of some for commands. there are 3 variables that > should be assigned in the parfor loop, and these variables have "cell" > type. on index of these variables is related to the outer for, the > other related to the parfor and the third one related to the inner > for. I define the variable in before the parfor as a cell value. But > I have the mentioned error again.
There are several possible reasons you might see that error, however it should be possible to make it work. For example, the following works fine (in R2014a, I didn't test any earlier releases):
x = cell(3,3,3) for idx = 1:3 parfor jdx = 1:3 for kdx = 1:3 x{idx, jdx, kdx} = rand(); end end end
Any chance you could post some code that reproduces the problem you're seeing? Also, which version of MATLAB are you using?
Cheers,
Edric.



