atsetenergy(ring,Energy) sets the Energy field in all elements to the value given by E. If no such field exists, it creates it.
0001 function newring = atsetenergy(ring,E) 0002 %atsetenergy(ring,Energy) sets the Energy field in all 0003 %elements to the value given by E. If no such field exists, it creates it. 0004 newring=ring; 0005 for j=1:length(ring) 0006 newring{j}.Energy = E; 0007 end