Hi Miguel.
Thanks for your question.
I see three errors in your code:
1) First, population should be a matrix, not a scalar, not a vector. a = [10:10] -> a = 10 -> "a" is a scalar
population matrix has dimensions:
number of rows = sum(PopulationSize) (Defaulf number for PopulationSize = [125 125 125 125]), so number of rows = 500
number of columns = number of variables, i.e., number of genes in the cell array "generxnList" (fourth input of OptGene function)
2) Second, population should be a logical matrix not a cell. a = {[10:10]})
>> iscell({[10:10]})
ans =
1
3) population should only contain 0s or 1s.
I suggest not to use PopulationSize as an input unless you are dealing with a time-consuming case (several days)
I you have more questions, don't hesitate to ask.
Best regards,