上一页 1 ··· 4 5 6 7 8

2014年10月25日

简单的遗传算法

摘要: %% 遗传算法clc;clear all;close all;%% 绘图x = -1:0.01:2;y = x .* sin(10 * pi.*x) + 2.0;plot(x,y,'b-','linewidth',2);hold on%% 初始化xmin = -1;%参数范围xmax = 2;%参数... 阅读全文

posted @ 2014-10-25 19:17 Kermit.Li 阅读(281) 评论(0) 推荐(0)

2014年10月23日

一维搜索

摘要: %% 一维搜索方法clc;clear all;close all;x = -2:0.01:2;y = 3*x.^2 - 4.*x + 2;plot(x,y,'r-.','linewidth',2);hold on %% 初始化x0 = 0;%初始值;k = 1;%初始步长;LL = 0.002;%终... 阅读全文

posted @ 2014-10-23 23:16 Kermit.Li 阅读(153) 评论(0) 推荐(0)

2014年10月22日

PSO 粒子群算法

摘要: 注:本人参考http://www.cnblogs.com/tiandsp/category/348031.html来实现的算法步骤:1.首先确定粒子个数与迭代次数。2.对每个粒子随机初始化位置与速度。3.采用如下公式更新每个粒子的位置与速度。Px=Px+Pv*t; %位置更新公式 Pv=Pv+(c1... 阅读全文

posted @ 2014-10-22 22:10 Kermit.Li 阅读(812) 评论(0) 推荐(0)

2014年10月21日

无聊,绘正方体

摘要: clc;clear all;close all;%% 画长方体% --------------xy底面---------------x = -10:1:10;y = x;[x,y]=meshgrid(x,y);z = -10*ones(size(x));p1 = surf(x,y,z);shadin... 阅读全文

posted @ 2014-10-21 14:37 Kermit.Li 阅读(206) 评论(0) 推荐(0)

2014年10月13日

matlab练习程序(正态分布贝叶斯分类)

摘要: clear all;close all;clc;randn('seed',0);mu1=[0 0];S1=[0.3 0;0 0.35];cls1_data=mvnrnd(mu1,S1,1000);plot(cls1_data(:,1),cls1_data(:,2),'+');hold on;mu2=... 阅读全文

posted @ 2014-10-13 22:22 Kermit.Li 阅读(669) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8

导航