data excel algorithm genetic

조회 수: 3 (최근 30일)
joni nababan
joni nababan 2020년 2월 16일
댓글: Walter Roberson 2020년 2월 21일
how do i implement genetic algorithms with excel data for ranking
  댓글 수: 2
Giuseppe Inghilterra
Giuseppe Inghilterra 2020년 2월 16일
Could you provide more details about your problem? (your trials, your code, etc..)
joni nababan
joni nababan 2020년 2월 20일
so i have problem to sort from highest to lowest value using matlab with genetic algorithm
can it be done?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
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
joni nababan
joni nababan 2020년 2월 20일
how about the genetic algorithm syntax code?
Walter Roberson
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 CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by