Home > classes > @specwin > string.m

string

PURPOSE ^

STRING writes a command string that can be used to recreate the input window object.

SYNOPSIS ^

function cmd = string(sw ,varargin)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input window object.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: STRING writes a command string that can be used to recreate the
              input window object.

 CALL:        cmd = string(sw)

 VERSION:     $Id: string.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $

 HISTORY:     29-03-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cmd = string(sw ,varargin)
0002 % STRING writes a command string that can be used to recreate the input window object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0007 %              input window object.
0008 %
0009 % CALL:        cmd = string(sw)
0010 %
0011 % VERSION:     $Id: string.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $
0012 %
0013 % HISTORY:     29-03-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION  = '$Id: string.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $';
0019 CATEGORY = 'Helper';
0020 
0021 % Check if this is a call for parameters
0022 if nargin == 2
0023   if isa(sw, 'specwin') && ischar(varargin{1})
0024     in = char(varargin{1});
0025     if strcmp(in, 'Params')
0026       cmd = plist();
0027       return
0028     elseif strcmp(in, 'Version')
0029       cmd = VERSION;
0030       return
0031     elseif strcmp(in, 'Category')
0032       cmd = CATEGORY;
0033       return
0034     end
0035   end
0036 end
0037 
0038 if length(sw) > 1
0039   cmd = '[';
0040 else
0041   cmd = '';
0042 end
0043 
0044 
0045 for j=1:length(sw)
0046   s = sw(j);
0047   if ~isempty(s.plist)
0048     cmd = [cmd sprintf(' specwin(%s)', string(s.plist))];
0049   else
0050 
0051     switch s.name
0052       case 'Kaiser'
0053         cmd = [cmd ' specwin(''' s.name ''', ' num2str(length(s.win)) ', ' num2str(s.psll) ')'];
0054       otherwise
0055         cmd = [cmd ' specwin(''' s.name ''', ' num2str(length(s.win)) ')'];
0056     end
0057   end
0058 end
0059 
0060 if length(sw) > 1
0061   cmd = [cmd ']'];
0062 end
0063 
0064 
0065 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003