⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p6.33.txt

📁 Matlab_Network_and_Application是国防工业出版社董长虹编著《神经网络与应用》的课本源码。
💻 TXT
字号:
%目标(三维)
T=[+1 +1;-1 +1;-1 -1];
%显示
axis([-1 1 -1 1 -1 1])
set(gca,'box','on');
axis manual;
hold on;
plot3(T(1,:),T(2,:),T(3,:),'r*')
title('Hopfield网络状态空间')
xlabel('a(1)');
ylabel('a(2)');
zlabel('a(3)');
view([37.5 30])
%设计网络
net=newhop(T);
%显示测试
a={rands(3,1)};
[y,Pf,Af]=sim(net,{1 10},{},a);
record=[cell2mat(a) cell2mat(y)];
start=cell2mat(a);
hold on
plot3(start(1,1),start(2,1),start(3,1),'bx',record(1,:),record(2,:),record(3,:))
%随机测试
color='rgbmy';
%过程显示
for i=1:25
a={rands(3,1)};
[y,Pf,Af]=sim(net,{1 10},{},a);
record=[cell2mat(a) cell2mat(y)];
start=cell2mat(a);
plot3(start(1,1),start(2,1),start(3,1),'bx',record(1,:),record(2,:),record(3,:))
end
%伪平衡点
P=[1 -1.0 -0.5 1 1 0;0 0 0 0 0 0;-1.0 1 0.5 -1 -1 0];
cla
plot3(T(1,:),T(2,:),T(3,:),'r*')
color='rgbmy';
%过程显示
for i=1:6
a={P(:,i)};
[y,Pf,Af]=sim(net,{1 10},{},a);
record=[cell2mat(a) cell2mat(y)];
start=cell2mat(a);
plot3(start(1,1),start(2,1),start(3,1),'bx',record(1,:),record(2,:),record(3,:))
end

⌨️ 快捷键说明

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