data excel algorithm genetic
3 ビュー (過去 30 日間)
古いコメントを表示
how do i implement genetic algorithms with excel data for ranking
2 件のコメント
Giuseppe Inghilterra
2020 年 2 月 16 日
Could you provide more details about your problem? (your trials, your code, etc..)
回答 (1 件)
Walter Roberson
2020 年 2 月 16 日
Use readtable() or xlsread() to read the data. Once it is read into MATLAB, MATLAB does not care where it came from, so it becomes just the same as using any other array or vector when you construct the objective function to minimize.
2 件のコメント
Walter Roberson
2020 年 2 月 21 日
Use whatever is appropriate for your purpose and your solver.
Example:
t = readtable('YourFile.xlsx');
x = t.x;
y = t.y;
model = @(P) P(1)*log(x) + P(2)*x.^2 + sin((P(1)+P(2))*pi*x);
residue = @(P) sum((model(P) - y).^2);
nvars = 2; A = [1 -1]; b = 0; Aeq = []; beq = []; nonlcon = [];
[bestP, fval] = ga(residue, nvars, A, b, Aeq, beq, nonlcon);
参考
カテゴリ
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!