MATLAB: Can we determine input varibles accuracy in genetic algorithm
genetic algorithm
hello dears,
I'm using genetic algorithm in matlab and i have two input variables (they are temperatures). I want the variables have the exact accuracy of 0.1. Is this possible?
Best Answer
You can round the numbers to one decimal place like this.
round(x*10)/10
Also note the 2nd optional input to round() since r2014b.
Use normal default MATLAB variables, not any other type.
The mixed-integer solver, as its name suggests, is MIXED-integer, meaning some variables can be continuous. To keep it simple, one data type is used for all variables.
bitstring variables have many limitations,documented here, such as no constraints are allowed.
Variables are standard MATLAB variables. The solution is a vector.
For mixed-integer optimization, variables are standard doubles. If you want a binary variable, give integer type. a lower bound of 0, and an upper bound of 1. Seethe documentation, which I tried to make clear.
Best Answer