I have a Matrix let we call it A Matrix, A[10*10] nodes and this matrix Aij=Aji as you see. How can i can create from this matrix a matrix when a node connect another node randomly and it will be done for all nodes but for examle if x node connected y node y node will not connect x again
$$A=\begin{bmatrix}0&1&0&1&1&0&1&1&0&0 \\ 1&0& 0& 1& 1& 0& 1& 1& 0& 0 \\ 0& 0& 0& 1& 1& 1& 0& 1& 1& 1 \\ 1& 1& 1& 0& 1& 1& 1& 1& 1& 1 \\ 1& 1& 1& 1& 0& 1& 1& 1& 1& 1 \\ 0& 0& 1& 1& 1& 0& 0& 1& 1& 1 \\ 1& 1& 0& 1& 1& 0& 0& 1& 0& 0 \\ 1& 1& 1& 1& 1& 1& 1& 0& 1& 1 \\ 0& 0& 1& 1& 1& 1& 0& 1& 0& 1 \\ 0& 0& 1& 1& 1& 1& 0& 1& 1& 0 \end{bmatrix}$$
txRange = 0.8;
global xLocation;
global yLocation;
xLocation = rand(numOfNodes,1) * envSize; yLocation = rand(numOfNodes,1) * envSize; distMatrix = zeros(numOfNodes,numOfNodes); for i=1:numOfNodes for j=1:numOfNodes distMatrix(i,j)=sqrt((xLocation(i)-xLocation(j))^2 + (yLocation(i)-yLocation(j))^2); end end global A; A = ( distMatrix < txRange); figure(1); plot(xLocation, yLocation, '.'); return; – doci Feb 01 '13 at 11:41