?? tracelatt.m
字號:
function traced = tracelatt(latt,varargin)%TRACELATT Trace for a lattice parameters% T = TRACELATT(L) calls GETLATT function and returns lattice% parameters for all lattice elements and stores their values into the% T variable in descending order. %% T = TRACELATT(L,'PropertyName',PropertyValue,...)% % Tracelatt Property List%% Display {'none'} | 'table'% Summary {'yes'} | 'no'% Echo 'on' | {'off'}%% Example:% Z2 = makelatt('Z',9,2);% RZ2 = rotlatt(Z2);% tracelatt(RZ2,'Echo','on','Display','table');%% See also GETLATT.% Copyright 2001-2003 Kamil Anis, anisk@feld.cvut.cz% Dept. of Radioelectronics, % Faculty of Electrical Engineering% Czech Technical University in Prague% $Revision: 0.1 $ $Date: 2003/1/16 17:33:28 $% --% <additional stuff goes here>global ECHOname = 'TRACELATT';[idt,tag] = iecho(name);nopts = length(varargin) / 2;opts = reshape(varargin,[2 nopts])';ord1 = strmatch('Echo',opts(:,1));ord2 = strmatch('Display',opts(:,1));ord3 = strmatch('Summary',opts(:,1));% Echoif ~isempty(ord1) % first check whether local option exists value1 = opts{ord1,2}; switch value1 case 'on' ech = 1; case 'off' ech = 0; otherwise disp(' '); disp([tag,'Invalid option for Echo property.']); disp([idt,'Possible values are ''on''|{''off''}.']); disp(' '); ech = 0; endelse if ~isempty(ECHO) % than check whether global option exists switch ECHO case 'on' ech = 1; case 'off' ech = 0; otherwise disp(' '); disp([tag,'Invalid option for Echo property.']); disp([idt,'Possible values are ''on''|{''off''}.']); disp(' '); ech = 0; end else % if there are no settings use the defaults ech = 0; % default value endend% Displayif isempty(ord2) % there's no such option report = 0; % default valueelse % there's relevant option value2 = opts{ord2,2}; switch value2 case 'table' report = 1; case 'none' report = 0; otherwise disp(' '); disp([tag,'Invalid option for Display property.']); disp([idt,'Possible values are {''none''}|''table''.']); disp(' '); report = 0; endend% Summary if isempty(ord3) % there's no such option summary = 1; % default valueelse % there's relevant option value3 = opts{ord3,2}; switch value3 case 'yes' summary = 1; case 'no' summary = 0; otherwise disp(' '); disp([tag,'Invalid option for Summary property.']); disp([idt,'Possible values are {''yes''}|''no''.']); disp(' '); summary = 1; endend%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BODY BEGIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%tic;[m,n] = size(latt);str1 = num2str(m);str2 = num2str(n); if ech disp(' '); disp([tag,'Tracing ',str1,' elemetns of ',str2,'-dimensional lattice.']); disp([idt,'This may take a while.']); disp([idt,'Please wait...']);endk = 1;for i = 1:m [vol,dist,herm,tau] = getlatt(latt,i); if isempty(vol) ~= 1 % store only non-empty parameters traced(k,:) = [i,vol,dist,herm,tau]; k = k + 1; end clear vol dist herm tauendtotaltime = toc;if (exist('traced') == 0) | (isempty(traced) == 1) disp(' '); disp([tag,'Insufficient number of lattice elements.']); disp([idt,'GETLATT returns empty vector for all lattice elements.']); disp([idt,'More elements are needed by TRACELATT.']); disp([idt,'Returning an empty output.']); disp(' '); traced = []; returnelse if ech [str6,str7,str8] = hms(totaltime,'Format','string'); disp([idt,'Total elapsed time -> ',str6,' hrs, ',str7,' min, ',str8,... ' sec.']); disp(' '); end str5 = '|----------+----------+----------+----------+----------|'; if report str3 = sprintf('| %8d | %8.2f | %8.2f | %8.2f | %8d |\n',traced'); disp(' '); disp('| Element | Volume | D2min | Hermite | Kiss |'); disp(str5); disp(str3); endend%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BODY END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if summary summ= max(traced(:,2:end)); str4 = sprintf('| %8d | %8.2f | %8.2f | %8.2f | %8d |\n',[i,summ]); disp(str5); disp('| Elements | Volume | D2min | Hermite | Kiss |'); disp(str5); disp(str4);end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -