atrotatelattice gives a new lattice starting with index as the first element. We assume that the lattice is a collumn cell array
0001 function newring = atrotatelattice(ring,index) 0002 %atrotatelattice gives a new lattice starting with index as the first 0003 %element. We assume that the lattice is a collumn cell array 0004 0005 if index>length(ring); 0006 error('index too big!'); 0007 end 0008 0009 if index==1 0010 newring=ring; 0011 else 0012 newring=[ring(index:end);ring(1:index-1)]; 0013 end