running a project using genetic algorithm
显示 更早的评论
I want to run a project using genetic algorithm and I don't know how.
This project have 4 functions that I attached this thesis here.
functions m files are in this thesis.
thank you guys.
2 个评论
Hikaru
2014-8-6
Copy the functions into an m-file. Save the 4 functions in separate m-files. While copy-and-pasting, the lines might have change, you have to check that syntax are all ok. Then click run (green play button) or type the function name in the command window.
I'm assuming that the 4 functions you meant are:
- GAmodule (pg 43-48)
- penalty2 (pg 49-50)
- bintranslate (pg 51-53)
- FEM2 (pg 54-56)
If so, it's better not to combine them. Make separate m-files, and make sure you have them all on your working directory.
If it does not work, then you should CHECK the syntax. I'm pretty sure the lines could change during copy-and-pasting. MATLAB reads code in one line, unless if there are ellipses (...) at the end to tell it to check the next line before execution. In the editor, you should see red bars that will point you to the lines with problem.
If you did all this and it still doesn't work, you should tell us what does the error message say.
You said, "does NOT worked", then tell us WHAT does not work.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!