Genetic Algorithm
1 回表示 (過去 30 日間)
古いコメントを表示
Hello.I am new to matlab so i am not very good it in.I have a problem.I wanted to do a fitness function which contains like below:
FitnessFunction,f=Mean(|Measured_data-Simulation_data|)
I have the measured data and i have put it in an excel file. The problem is how am i suppose to write it in GA?I just can't seem to create the function.Really am sorry for troubling you guys.
Thank you.
0 件のコメント
回答 (1 件)
Andrew Newell
2011 年 3 月 28 日
The first thing you need is to read in the data using xlsread and put it in the variable Measured_data. Then you can create your fitness function as an anonymous function like this:
fitness_function = @(x) mean(abs(Measured_data(:)-x(:)))
The nice thing about using an anonymous function is that the measured data become fixed parameters and you have a function of only one variable, as ga requires.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!