ImageVerifierCode 换一换
格式:TXT , 页数:18 ,大小:23.54KB ,
资源ID:14443309      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/14443309.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(部分MATLAB函数实现_精品文档.txt资料文档下载)为本站会员(b****2)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

部分MATLAB函数实现_精品文档.txt资料文档下载

1、cd c:my_dir %c:my_dirsave saf X Y Z %XYZ浽saf.matdir %棬Zclear %load saf Z %Zwho %1.Time=1 2 3 4 5 6 7 8 9 10 11 12 13X_Da=2.32 3.43;4.37 5.98vect_a=1 2 3 4 5Matrix_B=1 2 3; 2 3 4;3 4 5Null_M= %2a=2.7;b=13/25;C=1,2*a+i*b,b*sqrt(a);sin(pi/4),a+5*b,3.5+1R=1 2 3;4 5 6,M=11 12 13;14 15 16CN=R+i*M3symsym(1

2、2nsym_matrix=sym(A B C;NIHAO,Welcome,to beijing,sym_digits=sym(1 2 3;a b c;sin(x) cos(y) tan(z)clc;a,b,c;Jack,Help,Me!NO,WAY,!a=1/3 sqrt(2) 3.4234;exp(0.23) log(29) 23(-11.23)s=sym(a)4catA=cat(n,A1,A2,Am) %A1=1,2,3;4,5,6;7,8,9;A2=A1A3=A1-A2;A4=cat(3,A1,A2,A3)5zeros()zeros(n)zeros(m,n)zeros(m,n)zeros

3、(size(A)n=6;A=zeros(n)6eyeY=eye(n)eyem,n)eye(size(A)n=4;m=5;Y1=eye(n)Y2=eye(m,n)Y3=eye(size(Y1)7ones1Y=ones(n)ones(m,n)ones(size(A)m=6;X1=ones(m,n)d1=2;d2=3;d3=4;X2=ones(d1,d2,d3)8randY=rand(n)rand(m,n)rand(size(A)s=rand(state) 35rand(,s) S.,0) ,j) jj,sum(100*clock) R=rand(3,4)a=10;b=20;x=a+(b-a)*ra

4、nd(4)9randnY=randn(n) %n*nrandn %s=randn() 20.60.14mu=0.6;sigma=0.1;x=mu+sqrt(sigma)*randn(4)10randpermp=randperm(n) %1nrandperm(6)11linspacey=linspace(a,b %a,b)100y=linspace(a,b,n) %a,b) n 1-20010020a=1;b=200;y=linspace(a,b)z=linspace(a,b,100)a=0;12logspacey=logspace(a,b %10a,10b)50y=l0gspace(a,b,n

5、) %10a,10b)n 102-1045030a=2;b=4;x1=logspace(a,b)x2=logspace(a,b,30)13companA=compan(u)x-1)x+2)(x-3)x3-8*x+13u=1,0,-8,13;eig(A)u=1,-2,-5,6;han1=83.0 79.8 78.1 85.1 86.6 88.2 90.3 86.7 93.3 92.5 90.9 96.9101.7 85.1 87.8 91.6 93.4 94.5 97.4 99.5 104.2 102.3 101.0 123.592.2 114.0 93.3 101.0 103.5 105.2

6、109.5 109.2 109.6 111.2 121.7 131.3105.0 125.7 106.6 116.0 117.6 118.0 121.7 118.7 120.2 127.8 121.8 121.9139.3 129.5 122.5 124.5 135.7 130.8 138.7 133.7 136.8 138.9 129.6 133.7137.5 135.3 133.0 133.4 142.8 141.6 142.9 147.3 159.6 162.1 153.5 155.9163.2 159.7 158.4 145.2 124.0 144.1 157.0 162.6 171.

7、8 180.7 173.5 176.5;han1(end,:)=;m=size(han1,2); % x0=mean(han1,2); %han1x1=cumsum(x0); %x1(k)=x0(k-1)+x0(k)alpha=0.4;n=length(x0); %z1z1=alpha*x1(2:n)+(1-alpha)*x1(1:n-1) %z1 Y=x0(2:n);B=-z1,ones(n-1,1);ab=BY %abk=6; %k+1x7hat=(x0(1)-ab(2)/ab(1)*(exp(-ab(1)*k)-exp(-ab(1)*(k-1)%z=m*x7hat %u=sum(han1

8、)/sum(sum(han1) %=/v=z*u % 2renkourenkou1=rk(:,1); %renkourenkou2=rk(:,2); %renkourenkou3=rk(:,3); %renkoux0=renkou2 % %lamda=x0(1:n-1)./x0(2:n) %range=minmax(lamda) %x1=cumsum(x0) %x1for i=2:n z(i)=0.5*(x1(i)+x1(i-1);end %=0.5z1B=-z(2:n),ones(n-1,1); % %u=BY %u=(a,b)x=dsolve(Dx+a*x=bx(0)=x0 %x(1)=x

9、0x=subs(x,ax0,u(1),u(2),x1(1); %滻yuce1=subs(x,t,0:n-1); %digits(6),y=vpa(x) %x5yuce=x0(1),diff(yuce1)epsilon=x0-yuce %delta=abs(epsilon./x0) %rho=1-(1-0.5*u(1)/(1+0.5*u(1)*lamda %clc,clear %yuce(1)=x0(1);n yuce(i)=yuce1(i)-yuce1(i-1);yuce=vpa(yuce)2򵥰fplot(variable.*variable,0,31); %variable.

10、*variable?0,31NIND=4; %MAXGEN=10; %PRECI=5; % GGAP=1; %trace=zeros(2,MAXGEN); %FieldD=5;0;31;1;1; %Chrom=crtbp(NIND,PRECI); %gen=0; %variable=bs2rv(Chrom,FieldD); %ObjV=variable.*variable; %while genMAXGEN FitnV=ranking(-ObjV); % SelCh=select(sus,Chrom,FitnV,GGAP); % SelCh=recombin(xovsp,SelCh,1); %

11、飬100% SelCh=mut(SelCh); % variable=bs2rv(SelCh,FieldD); % ObjVSel=variable.*variable; % Chrom ObjV=reins(Chrom,SelCh,1,1,ObjV,ObjVSel); % variable=bs2rv(Chrom,FieldD); % gen=gen+1; %1 %Y,I Y,I=max(ObjV); hold on; plot(variable(I),Y,bo trace(1,gen)=max(ObjV); % trace(2,gen)=sum(ObjV)/length(ObjV); %g

12、rid,hold on;plot(variable,ObjV,b*figure(2);plot(trace(1,:);hold on;plot(trace(2,:),-.legend(仯仯򵥵,棬Max f(x1,x2)=100*(x1*x1-x2).2+(1-x1).2; -2.0480=x1,x2=bestv % bestv=fmax; % bvalxx=bval(indmax,: % optxx=xx(indmax,: %x1,x2 Bfit1(ii)=bestv; % 洢 % %(N-1) %N-1 r=rand; %r tmp=find(r=q); newbval(i,

13、:)=bval(tmp(1),: %r newbval(N,:)=bvalxx; % bval=newbval; %- %2:(N-1) % cc=rand; %cc if ccpc %0.8 point=ceil(rand*(2*L-1); %12L-1/ceil+1 ch=bval(i,: bval(i,point+1:2*L)=bval(i+1,point+1:2*L); bval(i+1,point+1:2*L)=ch(1,point+1:%ii+1point+12L bval(N,: %,i=79 % mm=rand(N,2*L)0 flag=0; for m=1:L-3 for n

14、=m+2:L-1 if d(c1(m),c1(n)+d(c1(m+1),c1(n+1)d(c1(m),c1(m+1)+d(c1(n),c1(n+1) flag=1; c1(m+1:n)=c1(n:-1:m+1); end end end end J(k,c1)=1:102;J=J/102;J(:,1)=0;,102)=1;,sum(clock);% A=J;dai % 01 B=A; c=randperm(w);% B w F=2+floor(100*rand(1); temp=B(c(i),F:102); B(c(i),F:102)=B(c(i+1),F: B(c(i+1),F:102)=t

15、emp;% C by=find(rand(1,w)p_best_fitness(count_x)p_best_fitness(count_x) = current_fitness(count_x);for count_y = 1:p_best(count_x,count_y) = particle_position(count_x,count_y);%decide on the global best among all the particlesg_best_val,g_best_index = max(current_fitness);%g_best contains the positi

16、on of teh global bestg_best(count_y) = particle_position(g_best_index,count_y);%update the position and velocity compponentsp_current(count_y) = particle_position(count_x,count_y);particle_velocity(count_y) = particle_velocity(count_y) + c1*rand*(p_best(count_y)-p_current(count_y) + c2*rand*(g_best(

17、count_y)-p_current(count_y);particle_positon(count_x,count_y) = p_current(count_y) +particle_velocity(count_y);g_bestcurrent_fitness(g_best_index)clear all, clc % pso exampleiter = 1000; % number of algorithm iterationsnp = 2; % number of model parametersns = 10; % number of sets of model parameters

18、Wmax = 0.9; % maximum inertial weightWmin = 0.4; % minimum inertial weightc1 = 2.0; % parameter in PSO methodologyc2 = 2.0;Pmax = 10 10; % maximum model parameter valuePmin = -10 -10; % minimum model parameter valueVmax = 1 1; % maximum change in model parameterVmin = -1 -1; % minimum change in mode

19、l parametermodelparameters(1:np,1:ns) = 0; % set all model parameter estimates for all model parameter sets to zeromodelparameterchanges(1: % set all change in model parameter estimates for all model parameter sets to zerobestmodelparameters(1: % set best model parameter estimates for all model para

20、meter sets to zerosetbestcostfunction(1:ns) = 1e6; % set best cost function of each model parameter set to a large numberglobalbestparameters(1:np) = 0; % set best model parameter values for all model parameter sets to zerobestparameters = globalbestparameters % best model parameter values for all m

21、odel parameter sets (to plot)globalbestcostfunction = 1e6; % set best cost function for all model parameter sets to a large numberi = 0; % indicates ith algorithm iterationj = 0; % indicates jth set of model parametersk = 0; % indicates kth model parameterfor k = 1:np % initializationfor j = 1:nsmod

22、elparameters(k,j) = (Pmax(k)-Pmin(k)*rand(1) + Pmin(k); % randomly distribute model parametersmodelparameterchanges(k,j) = (Vmax(k)-Vmin(k)*rand(1) + Vmin(k); % randomly distribute change in model parametersfor i = 2:iterx = modelparameters(:,j);% calculate cost functioncostfunction = 105*(x(2)-x(1)

23、2)2 + (1-x(1)2;if costfunction setbestcostfunction(j) % best cost function for jth set of model parametersbestmodelparameters(:,j) = modelparameters(:setbestcostfunction(j) = costfunction;4sj=d1;sj=sj*pi/180;S0=;Sum=inf;1000 S=1 1+randperm(100),102; temp=0; temp=temp+d(S(i),S(i+1); if tempSum S0=S;Sum=temp;e=0.130;L=20000;at=0.999;T=1;% L % c=2+floor(100*rand(1,2);c=sort(c);c1=c(1);c2=c(2); % df=d(S0(c1-1),S0(c2)+d(S0(c1),S0(c2+1)-d(S0(c1-1),S0(c1)-d(S0(c2),S0(c2+1); % if dfrand(1) end T=T*at; if Te break; % S0,Sumpath=S0;xx=sj(path,1);yy=sj(path,2);)

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1