?? fmap2.m
字號(hào):
%例6.6,fmap2.m
%
clear
P=rands(2,2000)*0.5;
x=0:0.1:3.1416*2;
plot(sin(x),cos(x)); %畫(huà)圓
axis('equal')
hold on
plot(P(1,:),P(2,:),'.g','markersize',10); %畫(huà)輸入點(diǎn)
hold off
disp('按任一鍵繼續(xù)')
pause
net=newsom(minmax(P),[5,5]); %創(chuàng)建科荷倫網(wǎng)絡(luò)
W0=rands(25,2)*0.1; %隨機(jī)產(chǎn)生權(quán)值
figure(2)
plot(sin(x),cos(x));
axis('equal')
hold on
plotsom(W0') %作神經(jīng)元權(quán)值圖
hold off
disp('按任一鍵繼續(xù)')
pause
net.trainParam.epochs=25; %最大訓(xùn)練次數(shù)
net.trainParam.show=5; %顯示間隔次數(shù)
net.iw{1,1}=W0; %賦權(quán)值
net = train(net,P); %訓(xùn)練網(wǎng)絡(luò)
figure(3)
plot(sin(x),cos(x),'--');
hold on
plotsom(net.iw{1,1},net.layers{1}.distances)
%畫(huà)權(quán)值點(diǎn)及其與相鄰權(quán)值點(diǎn)的連線(xiàn)
hold off
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -