"Joao Ejarque" <jme@dreammodel.dk> wrote in message
news:j42evh$cdn$1@newscl01ah.mathworks.com...
> 2 pretty basic questions.
> consider the program:
>
> n1=10; n2=20;
> V=zeros(n1,n2);
> X = rand(1,n2);
> Q = inline('operation with x and y','x','y');
> matlabpool(n),
> parfor j=1:n1
> zj = X(j) + 32;
> yj = j + 3;
> V(j,:) = ones(1,n2) + Q(zj,yj);
> end
> matlabpool close
>
> The questions:
> 1) is there any problem in calling in the variable X inside the parfor
> loop using X(j) as above?
> 2) any problem with using the inline function Q as above?
I don't see any problem offhand with your usage of either X or Q in the
above code assuming Q returns either a scalar or a 1byn2 vector when
called that way.
From the fact that it's simple to test whether or not this works if you have
Parallel Computing Toolbox and the body of your inline expression, I'm
guessing that either:
1) you don't have the Toolbox, in which case I _think_ that should work just
fine. Check with your sales representative if you're interested in a trial
of the Toolbox that will allow you to check this.
or 2) you tried this and it failed. In this case, if you want help
determining why it failed, you're going to need to provide some additional
information, like the body of the inline function Q and the exact text of
any error message you received.

Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
