?? fmap1.m
字號:
%例6.5,fmap1.m
%
clear
pi=3.1416;
x=0:0.5*pi/99:0.5*pi;
P=[sin(x);cos(x)]; %畫圓
plot(P(1,:),P(2,:),'b.'); %畫輸入點圖
axis('equal')
[R,Q]=size(P);
S=20;
W0=rands(S,R)*0.1; %隨機產生權值
hold on
plotsom(W0') %畫權值點及其與相鄰權值點的連線
hold off
disp('按任一鍵繼續')
pause
net=newsom(minmax(P),S); %創建科荷倫網絡
net.trainParam.epochs=200; %最大訓練次數
net.trainParam.show = 20;
net = train(net,P); %訓練網絡
figure(2)
plot(P(1,:),P(2,:),'.g','markersize',20) %畫輸入點
hold on
plotsom(net.iw{1,1},net.layers{1}.distances)
%作訓練后的權值點及其與相鄰權值點的連線
hold off
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -