0001 function elem = atbaselem(famname,method,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 DefaultNumIntSteps = 10;
0013
0014 [famname,rsrc] = getoption(varargin,'FamName',famname);
0015 [method,rsrc] = getoption(rsrc,'PassMethod',method);
0016 [lg,rsrc] = getoption(rsrc,'Length',0);
0017 elem = struct('FamName',famname,'PassMethod',method,'Length',lg,rsrc{:});
0018
0019
0020 ab = isfield(elem,{'PolynomA','PolynomB'});
0021 if any(ab)
0022 if ~ab(1), elem.PolynomA=[]; end
0023 if ~ab(2), elem.PolynomB=[]; end
0024 if ~isfield(elem,'MaxOrder')
0025 elem.MaxOrder=max([1 find(abs(elem.PolynomB)>0,1,'last') find(abs(elem.PolynomA)>0,1,'last')])-1;
0026 end
0027 la = length(elem.PolynomA);
0028 lb = length(elem.PolynomB);
0029 if la < elem.MaxOrder+1, elem.PolynomA=[elem.PolynomA zeros(1,elem.MaxOrder+1-la)]; end
0030 if lb < elem.MaxOrder+1, elem.PolynomB=[elem.PolynomB zeros(1,elem.MaxOrder+1-lb)]; end
0031 la = length(elem.PolynomA);
0032 lb = length(elem.PolynomB);
0033 if la < lb, elem.PolynomA = [elem.PolynomA zeros(1,lb-la)]; end
0034 if lb < la, elem.PolynomB = [elem.PolynomB zeros(1,la-lb)]; end
0035 if elem.Length ~= 0 && ~isfield(elem,'NumIntSteps')
0036 elem.NumIntSteps = DefaultNumIntSteps;
0037 end
0038 end
0039
0040 end