How can I insert the output of 'Polyfitn' directly to an optimization function in the same code?
Afficher commentaires plus anciens
Hello,
since a day I am working on this problem:
I generated a fit model f(X1,X2,X3) out of a data table with:
p = polyfitn([v,f,d],Ra,4)
Afterwards I try to convert it into a format which I could directly use for Genetic Algorithm Optimization.
functionRa = polyn2sym(p)
functionOptim = matlabFunction(functionRa)
If I try to use GA like this:
[X,fval] = ga(functionOptim,3,[],[],[],[],[LB1 LB2 LB3], [UB1 UB2 UB3])
I get the following error: _ Failure in initial user-supplied fitness function evaluation. GA cannot continue_
I would be very grateful if someone has an easy solution for my problem!
Thank you in advance!
Lukas
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Genetic Algorithm dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!