clear;
clc;
%网络训练样本
pConvert=importdata('C:\Users\Administrator\Desktop\ln\SelfOrganizationtrain.dat');
p=pConvert';
%训练样本的目标矩阵
t=importdata('C:\Users\Administrator\Desktop\ln\SelfOrganizationtarget.dat');
plot3(p(1,:),p(2,:),p(3,:),'o');
grid;box;
for i=1:29,text(p(1,i),p(2,i),p(3,i),sprintf(' %g',t(i))),end
hold off
f=t';
index1=find(f==1);
index2=find(f==2);
index3=find(f==3);
index4=find(f==4);
line(p(1,index1),p(2,index1),p(3,index1),'linestyle','none','marker','*','color','g');
line(p(1,index2),p(2,index2),p(3,index2),'linestyle','none','marker','*','color','r');
line(p(1,index3),p(2,index3),p(3,index3),'linestyle','none','marker','+','color','b');
line(p(1,index4),p(2,index4),p(3,index4),'linestyle','none','marker','+','color','y');
box;grid on;hold on;
axis([0 3500 0 3500 0 3500]);
title('训练用样本及其类别');
xlabel('A');
ylabel('B');
zlabel('C');
T=ind2vec(f);
spread=0;
% PNN网络的创建和训练过程
net=newpnn(p,T,spread);
A=sim(net,p);
Ac=vec2ind(A)
plot3(p(1,:),p(2,:),p(3,:),'r .'),grid;box;
axis([0 3500 0 3500 0 3500])
for i=1:29,text(p(1,i),p(2,i),p(3,i),sprintf(' %g',Ac(i))),end
hold off
f=Ac';
index1=find(f==1);
index2=find(f==2);
index3=find(f==3);
index4=find(f==4);
line(p(1,index1),p(2,index1),p(3,index1),'linestyle','none','marker','*','color','g');
line(p(1,index2),p(2,index2),p(3,index2),'linestyle','none','marker','*','color','r');
line(p(1,index3),p(2,index3),p(3,index3),'linestyle','none','marker','+','color','b');
line(p(1,index4),p(2,index4),p(3,index4),'linestyle','none','marker','+','color','y');
box;grid on;hold on;
title('网络训练结果');
xlabel('A');
ylabel('B');
zlabel('C');
%对待分类样本进行分类
pConvert=importdata('C:\Users\Administrator\Desktop\RBF\rbf_simulate_data.dat');
p=pConvert';
a=sim(net,p);
ac=vec2ind(a)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1、资源内容:基于Matlab实现神经网络RBF和PNN算法(源码+数据).rar 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab实现神经网络RBF和PNN算法(源码+数据).rar (5个子文件)
基于Matlab实现神经网络RBF和PNN算法(源码+数据)
rbf_simulate_data.dat 1KB
rbf_train_sample_data.dat 703B
rbf_train_target_data.dat 57B
rbf.m 2KB
PNN.m 2KB
共 5 条
- 1
Matlab仿真实验室
- 粉丝: 2w+
- 资源: 2179
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页