Discussion:
parfor loop and syms
(too old to reply)
s.23
2011-06-30 08:33:08 UTC
Permalink
Hi,

I am trying to use parfor loop to do subs command on symbolic expression but I get error:
MATLAB cannot determine whether "alphaTest" refers to a function or variable.
How can I define alphaTest as symbol in the parfor loop ?
code:
parfor y = 1:NoPars
....
symOneHes = subs(symMatrix(x,y),{alphaTest},{pars(1)});
end

symMatrix holds symblic expressions, pars vector holds parameter values, alphaTest symbol in symMatrix expressions.
Steven_Lord
2011-06-30 13:31:21 UTC
Permalink
Post by s.23
Hi,
MATLAB cannot determine whether "alphaTest" refers to a function or variable.
parfor y = 1:NoPars .... symOneHes =
subs(symMatrix(x,y),{alphaTest},{pars(1)}); end
symMatrix holds symblic expressions, pars vector holds parameter values,
alphaTest symbol in symMatrix expressions.
If you have this command inside the PARFOR loop:

syms alphaTest

replace it with:

alphaTest = sym('alphaTest');
--
Steve Lord
***@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
s.23
2011-06-30 19:10:25 UTC
Permalink
Thanks, that did it!

Loading...