MATLAB代做  | MATLAB代寫  | MATLAB有償編程
首 頁
當前位置:MATLAB代做|MATLAB代寫|MATLAB有償編程matlab源碼參考源碼matlab方面
基于matlab編程解決金融領域的指數復制的問題源碼程序        [↓跳到下載地址]
官方主頁:源碼共享網站:www.kggbzb.tw

聯系方式:客服QQ:1747812398 買代碼源碼軟件站,歡迎咨詢

運行環境:Win9X/2000/XP/2003/

源碼語言:簡體中文

源碼類型:源碼程序 - 參考源碼 - matlab方面

推薦星級:

更新時間:2016-04-05 22:34:49

源碼簡介

%GADEMO1 Introduction to the Genetic Optimization Toolbox

clf;
figure(gcf);
more on
echo on
clc
%    ==========================================================
%    GADEMO 1
%    ==========================================================

%    INITIALIZE - Initialize a poplutaton of solutions
%    GA         - Simulates evolution

pause % Strike any key for the introduction to Genetic Algorithms
clc

%    Genetic algorithms

%    A genetic algorithm is a simulation of evolution where the
%    rule of survival of the fittest is applied to a population
%    of individuals.
%    The basic genetic algorithm is as follows:
%      1. Create an initial population (usually a randomly
%         generated string)
%      2. Evaluate all of the individuals (apply some function
%         or formula to the individuals)
%      3. Select a new population from the old population based
%         on the fittness of the individuals as given by the
%         evaluation function.
%      4. Apply some genetic operators (mutation & crossover)
%         to members of the population to create new solutions.
%      5. Evaluate these newly created individuals.
%      6. Repeat steps 3-6 (one generation) until the
%         termination criteria has been satisfied (usually
%         perform for a certain fixed number of generations)
%
%    Let's look at an example

pause % Strike any key to define the problem...
clc

%   Let's consider the maximization of the following function:
%   f(x) = x + 10*sin(5*x)+7*cos(4*x) over the interval (0,9)
fplot('x + 10*sin(5*x)+7*cos(4*x)',[0 9])

%   Now, let's set up a genetic algorithm to find the maximum
%   of this problem.  First, we need to create the evaluation
%   function .m file, here is gademo1eval1.m

pause     % Strike any key to look at gademo1eval1.m
type gademo1eval1.m
pause      % Strike any key to continue
clc

%   Note that the evaluation function must take two parameters,
%   sol and options.  Sol is a row vector of n+1 elements where
%   the first n elements are the parameters of interest.  The
%   n+1'th element is the value of this solution.  The options
%   matrix is a row matrix of
%   [current generation, eval options]
%   The eval function must return both the value of the sting,
%   val and the string itself, sol.  This is done so that
%   your evaluation can repair and/or improve the string.

pause      % Strike any key to continue
clc

%   Now that we have defined the evaluation function, we now
%   have to create an initial population.  The most common way
%   to generate an initial population is to randomly generate
%   solutions within the range of interest, in this case 0-9.
%   The initializega routine will do this for you.

pause     % Strike any key for help on initializega
clc
help initializega
pause      % Strke any key to continue.
clc
%   Let's create a random starting popluation of size 10.
initPop=initializega(10,[0 9],'gademo1eval1');
pause      % Strke any key to continue.

%   We can now take a look at this population.
hold on
plot (initPop(:,1),initPop(:,2),'g+')
pause % Strike any key to continue
clc
%  We can now run the evolutionary procedure on this
%  population.
help ga
pause      % Strike any key to continue

% Now let's run the ga for one generation.
[x endPop] = ga([0 9],'gademo1eval1',[],initPop,[1e-6 1 1],'maxGenTerm',1,...
  'normGeomSelect',[0.08],['arithXover'],[2 0],'nonUnifMutation',[2 1 3]);

x %The best found
%And plot the resulting the resulting population
plot (endPop(:,1),endPop(:,2),'ro')
pause      % Strike any key to continue

% Now let's run the ga for 25 generations
[x endPop] = ga([0 9],'gademo1eval1',[],initPop,[1e-6 1 1],'maxGenTerm',25,...
  'normGeomSelect',[0.08],['arithXover'],[2],'nonUnifMutation',[2 25 3]);
x %The best found
% And plot the resulting the resulting population
plot (endPop(:,1),endPop(:,2),'y*')

% End of gademo1


提 示:本站所有源碼只提供瀏覽,需要定制的朋友可以聯系在線客服!
注意:價格根據項目的難易程度來定價格業務咨詢

基于matlab編程解決金融領域的指數復制的問題源碼程序 --下載地址

注意:為避免不必要的誤會,本站項目里的源碼只公開部分需要的聯系在線客服

本站長期招聘程序代寫高手,歡迎加入華南地區matlab團隊

想創業卻沒有經驗的人

無論你是否有過網上開店的經驗,都可以隨時聯系在線客服,建立自己獨立的網站
想開網店卻不知道如何入手

淘寶創業成本低而且風險小,如果想開淘寶店的朋友可以聯系在線客服。
想兼職創業,卻不擅長交際與服務的人

在家創業月入5000元。網站程序+百套群發工具+網賺資料+域名+空間+本站終身代理資格,這樣你網賺的條件全具備了。每天3小時管理、推廣、收錢。
缺乏能快速贏利型產品的人

導入多種最新流行營銷軟件+網賺教程,讓入駐者輕松加盟、復制有效成交技巧、快速賺錢。

源碼評論評論內容只代表網友觀點,與本站立場無關!

   評論摘要(共 0 條,得分 0 分,平均 0 分) 查看完整評論

瀏覽說明

* 本站所有源碼全部公開,隨時隨地瀏覽!
* MATLAB軟件如用于商業用途,請購買正版!
* 如果您發現下載鏈接錯誤,請點擊報告錯誤謝謝!
* 站內提供的所有軟件包含破解及注冊碼均是由網上搜集,若侵犯了你的版權利益,敬請來信通知我們!
Copyright © 2008-2014 www.kggbzb.tw. All Rights Reserved.
頁面執行時間:265.62500 毫秒
安微25选5开奖号