how to evaluate a function in string with parfor?
Ältere Kommentare anzeigen
Hi everybody, I have a problem evaluating the value of a function in string with parfor. Before I started using parfor, I used "eval", which worked quite well. I know "eval" does not work well with parfor and the one recommended the most online is "feval". However, I do not know how to use it. More specifically, i am doing genetic programming with the following code randomly generating a function for each individual.
parfor v = 1:8;
popu{v} = gpols_init(popusize,maxtreedepth,symbols);
tree{v} = popu{v}.chrom{jf}.tree;
aa{1,jf,v} = tree_stringrc(tree{v},1,symbols);
end
The output in "aa" looks like the following.
val(:,:,1) =
'XX(iv,1)' '(XX(iv,9))/(XX(iv…' '(((XX(iv,7))*exp(…' '(XX(iv,1))*sqrt(X…' '((XX(iv,2))*log((…'
what I need to do is to evaluate the value of each expression, which I do not know how to do. I will appreciate if someone could help me with it. Thanks. Best, J.
3 Kommentare
If your code "worked quite well", why do you need to use parfor?
Julie G
am 14 Nov. 2017
Bearbeitet: Walter Roberson
am 17 Nov. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Parallel Computing Fundamentals finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!