Home > classes > @ao > string.m

string

PURPOSE ^

STRING writes a command string that can be used to recreate the input Analysis object(s).

SYNOPSIS ^

function cmd = string(as)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input Analysis object(s).

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

 DESCRIPTION: STRING writes a command string that can be used to recreate the
              input Analysis object(s).

 CALL:        cmd = string(a1)

 VERSION:     $Id: string.m,v 1.4 2007/08/14 09:21:13 ingo Exp $

 HISTORY: 29-03-07 M Hewitson
             Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cmd = string(as)
0002 % STRING writes a command string that can be used to recreate the input Analysis object(s).
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0007 %              input Analysis object(s).
0008 %
0009 % CALL:        cmd = string(a1)
0010 %
0011 % VERSION:     $Id: string.m,v 1.4 2007/08/14 09:21:13 ingo Exp $
0012 %
0013 % HISTORY: 29-03-07 M Hewitson
0014 %             Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 cmd = '[';
0019 
0020 for j=1:length(as)
0021   a = as(j);
0022 
0023   hist = get(a, 'hist');
0024   pl   = get(hist, 'plist');
0025 
0026   if isempty(pl)
0027     error('### this AO was not created with a plist. Can''t convert to string.');
0028   end
0029 
0030   plstr = string(pl);
0031 
0032   cmd = [cmd 'ao(' ...
0033              plstr ...
0034              ') '];
0035 end
0036 
0037 cmd = [cmd ']'];
0038 
0039 if strcmp(cmd, '[]')
0040   cmd = '';
0041 end
0042 
0043 % END

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003