To plot a minimized fitness function at the y-axis and set its range with the generation number at the x-axis in MATLAB, you can follow these steps:
ylim
function.plot
function with the generation numbers on the x-axis and the fitness function values on the y-axis.Here is an example code snippet that demonstrates this process:
main.m405 chars17 lines
Make sure to replace fitness
and generations
with your actual data.
This code will plot the fitness function values on the y-axis, with the range of the y-axis set based on the minimum and maximum fitness values. The x-axis will show the corresponding generation numbers.
Note: Make sure you have MATLAB installed on your system to run this code.
gistlibby LogSnag