add_ID adds IDelem at the beginning and subtracts the length from the surrounding straights
0001 function [ ringID ] = add_ID( ring, IDelem ) 0002 %add_ID adds IDelem at the beginning and subtracts the length from 0003 % the surrounding straights 0004 0005 ringID={IDelem,ring{:}}; 0006 IDlen=IDelem.Length; 0007 0008 driftInd=findcells(ringID,'FamName','SDHI'); 0009 ringID{driftInd(1)}.Length=ringID{driftInd(1)}.Length-IDlen/2; 0010 ringID{driftInd(end)}.Length=ringID{driftInd(end)}.Length-IDlen/2; 0011 0012 end 0013