how to generate chromosome?
Show older comments
Matlab Code for generating a random population of 40 chromosome having 20 genes each. Value of the genes are 0 and 1.
Accepted Answer
More Answers (1)
Abdolkarim Mohammadi
on 14 Aug 2020
Edited: Abdolkarim Mohammadi
on 15 Aug 2020
Assuming you want search agents in the rows and design variables in the columns:
PopulationSize = 40;
nvars = 20;
Population = randi ([0,1], [PopulationSize,nvars]);
Categories
Find more on Expression Analysis 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!