% Solve a Clustering Problem with a Self-Organizing Map
% Script generated by NCTOOL
% Created Sun Mar 11 13:48:36 CST 2012
%
% This script assumes these variables are defined:
%
% a - input data.
rng(0)
% 自定义语句------------------------
a= [0.9659 0.2588 -0.2588 0.9659 -0.9659 -0.9659;...
0.2588 0.9659 0.9659 -0.2588 -0.2588 0.2588];
% ---------------------------------
inputs = a;
% Create a Self-Organizing Map
dimension1 = 2;
dimension2 = 2;
net = selforgmap([dimension1 dimension2]);
% Train the Network
[net,tr] = train(net,inputs);
% Test the Network
outputs = net(inputs);
% View the Network
view(net)
% 自定义语句----------------------------
t=0:.2:2*pi+.2;
b=[cos(t);sin(t)];
y=sim(net,b);
y=vec2ind(y);
yu=unique(y);
N=length(yu);
fprintf('测试数据共分为 %d 类\n', N);
for i=1:N
yu_num(i)=sum(y==yu(i));
fprintf('第 %d 类包含 %d 个点\n', i, yu_num(i));
end
% ------------------------------------------
% Plots
% Uncomment these lines to enable various plots.
%figure, plotsomtop(net)
%figure, plotsomnc(net)
%figure, plotsomnd(net)
%figure, plotsomplanes(net)
%figure, plotsomhits(net,inputs)
%figure, plotsompos(net,inputs)
plot(b(1,y==yu(1)),b(2,y==yu(1)),'ro');
hold on;
plot(b(1,y==yu(2)),b(2,y==yu(2)),'b+');
plot(b(1,y==yu(3)),b(2,y==yu(3)),'k*');
plot(b(1,y==yu(4)),b(2,y==yu(4)),'m^');
hold off;
legend('第一类','第二类','第三类','第四类');
用GUI设计神经网络.rar_animalzm6_matlab_substance74s_神经网络_神经网络GUI
版权申诉
149 浏览量
2022-09-24
23:49:53
上传
评论
收藏 3KB RAR 举报
weixin_42651887
- 粉丝: 79
- 资源: 1万+
最新资源
- vscode配置c/c 环境教程
- vscode配置c/c 环境教程
- 基于matlab实现电磁优化计算功能,进行线型规划优化电磁设计.rar
- 基于matlab实现带精英策略的非支配排序遗传算法matlab 源码.rar
- 基于matlab实现差分进化算法,最新的用于替代遗传算法,是以后的主要发展方法.rar
- VSCode配置c/c++环境教程.md
- 基于matlab实现标准合作型协同进化遗传算法matlab源程序
- 七下人教.zip
- 基于matlab实现本份代码能对图像进行gabor滤波处理,结合指纹方向图以及指纹沟壑频率特性,对指纹图像进行增强.rar
- 基于matlab实现RBM神经网络实现了手写数字体识别的GUI程序.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0