0001 function [T, badlist, errorstr] = isatlattice(LATTICE,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 T = 1;
0018 errorstr = [];
0019 badlist = [];
0020
0021 DISPLAYFLAG = 0;
0022 STOPFLAG = 0;
0023
0024 if any(strncmpi(varargin,'disp',4))
0025 DISPLAYFLAG = 1;
0026 end
0027
0028 if any(strncmpi(varargin,'stop',4))
0029 STOPFLAG = 1;
0030 end
0031
0032 if ~ iscell(LATTICE)
0033 errorstr = [errorstr,sprintf('%s\n','Input is not a MATLAB cell array')];
0034 T = 0;
0035 else
0036 for k = 1:length(LATTICE)
0037 [t, s] = isatelem(LATTICE{k});
0038 if ~t
0039 badlist = [badlist, k];
0040 T = 0;
0041 if DISPLAYFLAG
0042 s = [sprintf('\nInvalid lattice element # %s\n', int2str(k)),s];
0043 disp(s);
0044 end
0045 if STOPFLAG
0046 return
0047 end
0048 end
0049 end
0050 errorstr = 'One or more elements are not valid AT elements';
0051 end