📄 som_unit_neighs.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html><head><title>SOM Toolbox / som_unit_neighs </title></head><body bgcolor=#f0f0f0><table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td valign=baseline><font size=+2>SOM Toolbox</font></td><td valign=baseline align=center><a href="somtoolbox.html">Online documentation</td><td valign=baseline align=right><a href="http://www.cis.hut.fi/projects/somtoolbox/" target="_top">http://www.cis.hut.fi/projects/somtoolbox/</a></td></tr></table><hr><H1> som_unit_neighs </H1><H3> Purpose </H3><PRE> Find the adjacent (in 1-neighborhood) units for each map unit of a SOM based on given topology.</PRE><H3> Syntax </H3><UL><PRE> Ne1 = som_unit_neighs(sMap); Ne1 = som_unit_neighs(sM.topol); Ne1 = som_unit_neighs(msize); Ne1 = som_unit_neighs(msize,'hexa'); Ne1 = som_unit_neighs(msize,'rect','toroid');</PRE></UL><H3> Description </H3><PRE> For each map unit, find the units the distance of which from the map unit is equal to 1. The distances are calculated along the map grid. Consider, for example, the case of a 4x3 map. The unit ('1' to 'C') positions for 'rect' and 'hexa' lattice (and 'sheet' shape) are depicted below: 'rect' lattice 'hexa' lattice -------------- -------------- 1 5 9 1 5 9 2 6 a 2 6 a 3 7 b 3 7 b 4 8 c 4 8 c The units in 1-neighborhood (adjacent units) for unit '6' are '2','5','7' and 'a' in the 'rect' case and '5','2','7','9','a' and 'b' in the 'hexa' case. The function returns a sparse matrix having value 1 for these units. Notice that not all units have equal number of neighbors. Unit '1' has only units '2' and '5' in its 1-neighborhood. </PRE><H3> Required input arguments </H3><PRE> topol Map grid dimensions. (struct) topology struct or map struct, the topology (msize, lattice, shape) of the map is taken from the appropriate fields (see e.g. SOM_SET) (vector) the vector which gives the size of the map grid (msize-field of the topology struct).</PRE><H3> Optional input arguments </H3><PRE> lattice (string) The map lattice, either 'rect' or 'hexa'. Default is 'rect'. 'hexa' can only be used with 1- or 2-dimensional map grids. shape (string) The map shape, either 'sheet', 'cyl' or 'toroid'. Default is 'sheet'. </PRE><H3> Output arguments </H3><PRE> Ne1 (matrix) sparse matrix indicating units in 1-neighborhood by 1, all others have value 0 (including the unit itself!), size is [munits munits]</PRE><H3> Examples </H3><PRE> Simplest case: Ne1 = som_unit_neighs(sTopol); Ne1 = som_unit_neighs(sMap.topol); Ne1 = som_unit_neighs(msize); Ne1 = som_unit_neighs([10 10]); If topology is given as vector, lattice is 'rect' and shape is 'sheet' by default. To change these, you can use the optional arguments: Ne1 = som_unit_neighs(msize, 'hexa', 'toroid'); The neighbors can also be calculated for high-dimensional grids: Ne1 = som_unit_neighs([4 4 4 4 4 4]);</PRE><H3> See also </H3><TABLE NOBORDER WIDTH=80%><TR><TD><a href="som_neighborhood.html"><B>som_neighborhood</B></a><TD> Calculate N-neighborhoods of map units.<TR><TD><a href="som_unit_coords.html"><B>som_unit_coords</B></a><TD> Calculate grid coordinates.<TR><TD><a href="som_unit_dists.html"><B>som_unit_dists</B></a><TD> Calculate interunit distances.<TR><TD><a href="som_connection.html"><B>som_connection</B></a><TD> Connection matrix.</TABLE><p><hr><br><br><!-- Last updated: May 30 2002 --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -