calculatefitnessvalue.m

来自「X(t)=Asin(2*pi *f *t+ q)+n(t) 估计其中的参数为」· M 代码 · 共 19 行

M
19
字号
function [ Fitness ] = CalculateFitnessValue( Value , Vmax , Vmin , FunctionMode)
% To calculate fitness value
% FunctionMode : 
%                        >= 0 find the maximum of the function
%                        < 0   find the minimum of the function
% Fitness is big than 0 
if FunctionMode >= 0
    if (Value + Vmin) > 0
        Fitness = Value + Vmin ;
    else
        Fitness = 0;
    end
else 
    if Value < Vmax
        Fitness = Vmax - Value ;
    else
        Fitness = 0;
    end    
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?