ga algorithm with vectors
Show older comments
function y=funcion(d)
y=(2*(pi*(d(1)^2)/4))+(d(2)*(pi*(d(3)^2)/4))
%d(1)=[ 6 8 10 12], d(3)=[ 6 8 10 12], round(d(2))
y=570;
end
fit=@(d)funcion(d)
nvars=3;
[d,fval]=ga(fit,nvars)
How to solve a function through ga algortihm, if you have 3 variables, and two of them must be choosen between the numbers of a vector, and the third variable must be entire number?
Accepted Answer
More Answers (0)
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!