0001 function re=setANYshift(r,pos,coord,D)
0002
0003
0004
0005
0006
0007 numelems = length(pos);
0008
0009 if coord<1 | coord>6
0010 error('coord should be an index vector between 1 and 6')
0011 end
0012
0013 if (numelems ~= length(D))
0014 error('pos, D must have the same number of elements');
0015 end
0016
0017 additive=0;
0018
0019 for i = 1:length(pos)
0020 if abs(D(i))<1e-12, D(i)=0; end;
0021
0022 if additive
0023 r{pos(i)}.T1(coord,1) = r{pos(i)}.T1(coord,1) -D(i);
0024 r{pos(i)}.T2(coord,1) = r{pos(i)}.T1(coord,1) +D(i);
0025 else
0026 r{pos(i)}.T1(coord,1) = -D(i);
0027 r{pos(i)}.T2(coord,1) = D(i);
0028 end
0029 end
0030
0031 re=r;