0001 function ring=atsetbpmerr(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 global THERING
0018 if ~iscell(varargin{1})
0019 THERING=atsetbpmerr(THERING,varargin{:});
0020 else
0021 [ring,idx,ox,oy,gx,gy,rx,ry,rot]=deal(varargin{:});
0022
0023 if length(ox) == 1
0024 ox=ox*ones(size(idx));
0025 elseif length(ox) ~= length(idx)
0026 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(ox));
0027 end
0028 if length(oy) == 1
0029 oy=oy*ones(size(idx));
0030 elseif length(oy) ~= length(idx)
0031 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(oy))
0032 end
0033
0034 if length(gx) == 1
0035 gx=gx*ones(size(idx));
0036 elseif length(gx) ~= length(idx)
0037 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(gx));
0038 end
0039 if length(gy) == 1
0040 gy=gy*ones(size(idx));
0041 elseif length(gy) ~= length(idx)
0042 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(gy))
0043 end
0044
0045 if length(rx) == 1
0046 rx=rx*ones(size(idx));
0047 elseif length(rx) ~= length(idx)
0048 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(rx));
0049 end
0050 if length(ry) == 1
0051 ry=ry*ones(size(idx));
0052 elseif length(ry) ~= length(idx)
0053 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(ry))
0054 end
0055
0056 if length(rot) == 1
0057 rot=rot*ones(size(idx));
0058 elseif length(rot) ~= length(idx)
0059 error('AT:length','Vector lengths are incompatible: %i/%i.',length(idx),length(rot))
0060 end
0061
0062
0063 ring(idx)=cellfun(@(el,a,b)setfield(el,'Offset',[a,b]),ring(idx),num2cell(ox),num2cell(oy),'un',0);
0064 ring(idx)=cellfun(@(el,a,b)setfield(el,'Scale',1+[a,b]),ring(idx),num2cell(gx),num2cell(gy),'un',0);
0065 ring(idx)=cellfun(@(el,a,b)setfield(el,'Reading',[a,b]),ring(idx),num2cell(rx),num2cell(ry),'un',0);
0066 ring(idx)=cellfun(@(el,a)setfield(el,'Rotation',a),ring(idx),num2cell(rot),'un',0);
0067
0068
0069 end