📄 kohonen.m
字号:
function [W,M]=Kohonen(s)
p=[0 1;0 1;0 1];
%s=10;
M=nbgrid(s);
W=initsm(p,s);
pause
clc
tp=[25 4000 0.5];
fpa=fopen('g:\lfx\newtask\trainingdata2\SXcropland.txt','r');
fpb=fopen('g:\lfx\newtask\trainingdata2\SXwater.txt','r');
fpc=fopen('g:\lfx\newtask\trainingdata2\SXforesty.txt','r');
fpd=fopen('g:\lfx\newtask\trainingdata2\SXresident.txt','r');
fpe=fopen('g:\lfx\newtask\trainingdata2\SXteasample.txt','r');
loop=120;
for i=1:loop
clf;
[class_a,count1]=fscanf(fpa,'%d',[3,1]);
[class_b,count2]=fscanf(fpb,'%d',[3,1]);
[class_c,count3]=fscanf(fpc,'%d',[3,1]);
[class_d,count4]=fscanf(fpd,'%d',[3,1]);
[class_e,count5]=fscanf(fpe,'%d',[3,1]);
class=[class_a,class_b,class_c,class_d,class_e];
x_max=150;
x_min=10;
k=x_max-x_min;
class=(class-x_min)/k;
p=class;
W=trainsm(W,M,p,tp);
disp('function complete');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -