《云模型matlab程序(7页).doc》由会员分享,可在线阅读,更多相关《云模型matlab程序(7页).doc(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、-云模型matlab程序-第 7 页Ex=18En=2hold onfor i=1:1000Enn=randn(1)*He+En;x(i)=randn(1)*Enn+Ex;y(i)=exp(-(x(i)-Ex)2/(2*Enn2);plot(x(i),y(i),*)endhold onfor i=1:1000Enn=randn(1)*He+En;x(i)=randn(1)*Enn+Ex;y(i)=exp(-(x(i)-Ex)2/(2*Enn2);plot(x(i),y(i),*)end2.求期望、熵及超熵X1=51.93 52.51 54.70 43.14 43.85 44.48 44.61
2、52.08;Y1=0.91169241573 0.921875 0.96032303371 0.75737359551 0.76983848315 0.7808988764 0.78318117978 0.9143258427;m=8;Ex=mean(X1)En1=zeros(1,m);for i=1:m En1(1,i)=abs(X1(1,i)-Ex)/sqrt(-2*log(Y1(1,i);endEn=mean(En1);He=0;for i=1:m He=He+(En1(1,i)-En)2;endEn=mean(En1)He=sqrt(He/(m-1)3.平顶山so2环境:X1=0.01
3、3 0.04 0.054 0.065 0.07 0.067 0.058 0.055 0.045;78378378 0.945945946 0.905405405 0.783783784 0.743243243 0.608108108;m=9;Ex=mean(X1)En1=zeros(1,m);for i=1:m En1(1,i)=abs(X1(1,i)-Ex)/sqrt(-2*log(Y1(1,i);endEn=mean(En1);He=0;for i=1:m He=He+(En1(1,i)-En)2;endEn=mean(En1)He=sqrt(He/(m-1)1.绘制正向云图Ex=18En
4、=2hold onfor i=1:1000Enn=randn(1)*He+En;x(i)=randn(1)*Enn+Ex;y(i)=exp(-(x(i)-Ex)2/(2*Enn2);plot(x(i),y(i),*)endhold onfor i=1:1000Enn=randn(1)*He+En;x(i)=randn(1)*Enn+Ex;y(i)=exp(-(x(i)-Ex)2/(2*Enn2);plot(x(i),y(i),*)end2.逆向云发生器中需要剔除隶属度大于0. 9999 的云滴,剩下 个云滴。代码如下: x=51.93,52.51,54.7,56.96,43.14,43.85,
5、44.48,44.61,52.08; y=0.91169241573,0.921875,0.96032303371,1,0.75737359551,0.76983848315,0.7808988764,0.78318117978,0.9143258427;X1=x;Y1=y;i=1;n=9;flag=0;m=0;while i=(n-flag) Y1(:,i)=; X1(:,i)=; flag=flag+1; else i=i+1; m=m+1; endendmX1Y1输出:m=8X1=51.93 52.51 54.70 43.14 43.85 44.48 44.61 52.08;%除以去掉的
6、56.96得到Y1,云模型在水资源供求预测中的应用Y1=0.91169241573 0.921875 0.96032303371 0.75737359551 0.76983848315 0.7808988764 0.78318117978 0.9143258427;%确定度或者隶属度求期望、熵及超熵X1=51.93 52.51 54.70 43.14 43.85 44.48 44.61 52.08;%除以去掉的56.96得到Y1,云模型在水资源供求预测中的应用Y1=0.91169241573 0.921875 0.96032303371 0.75737359551 0.76983848315 0.7808988764 0.78318117978 0.9143258427;%确定度或者隶属度m=8;Ex=mean(X1)En1=zeros(1,m);for i=1:m En1(1,i)=abs(X1(1,i)-Ex)/sqrt(-2*log(Y1(1,i);endEn=mean(En1);He=0;for i=1:m He=He+(En1(1,i)-En)2;endEn=mean(En1)He=sqrt(He/(m-1)