Home > classes > @ao > string.m

string

PURPOSE ^

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

SYNOPSIS ^

function cmd = string(as)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input
 Analysis object(s).
 
 M Hewitson 29-03-07
 
 $Id: string.html,v 1.1 2007/06/08 14:15:03 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003