Grid layer topology function
pos = gridtop calculates neuron positions for layers whose neurons are arranged in an N-dimensional grid.
gridtop(dim1,dim2,...,dimN) takes N arguments,
Length of layer in dimension i
and returns an N-by-S matrix of N coordinate vectors where S is the product of dim1*dim2*...*dimN.
This code uses gridtop to directly create a two-dimensional layer with 40 neurons arranged in an 8-by-5 grid; then uses the function as an input to selforgmap to create weight positions of neurons for a self-organizing map and plots the neuron topology.
pos = gridtop(8,5); net = selforgmap([8 5],'topologyFcn','gridtop'); plotsomtop(net)