Home > classes > @ao > export.m

export

PURPOSE ^

EXPORT export an analysis object to a text file.

SYNOPSIS ^

function varargout = export(a, fname)

DESCRIPTION ^

 EXPORT export an analysis object to a text file.

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

 DESCRIPTION: EXPORT export an analysis object to a text file.

 CALL:        export(a, 'blah.txt');

 VERSION:     $Id: export.m,v 1.7 2008/01/22 20:59:42 hewitson Exp $

 HISTORY: 30-03-07 M Hewitson
             Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = export(a, fname)
0002 % EXPORT export an analysis object to a text file.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: EXPORT export an analysis object to a text file.
0007 %
0008 % CALL:        export(a, 'blah.txt');
0009 %
0010 % VERSION:     $Id: export.m,v 1.7 2008/01/22 20:59:42 hewitson Exp $
0011 %
0012 % HISTORY: 30-03-07 M Hewitson
0013 %             Creation
0014 %
0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0016 
0017 VERSION  = '$Id: export.m,v 1.7 2008/01/22 20:59:42 hewitson Exp $';
0018 CATEGORY = 'Output';
0019 
0020 %% Check if this is a call for parameters
0021 if nargin == 2
0022   if isa(a, 'ao') && ischar(fname)
0023     in = char(fname);
0024     if strcmp(in, 'Params')
0025       varargout{1} = plist();
0026       return
0027     elseif strcmp(in, 'Version')
0028       varargout{1} = VERSION;
0029       return
0030     elseif strcmp(in, 'Category')
0031       varargout{1} = CATEGORY;
0032       return
0033     end
0034   end
0035 end
0036 
0037 if isa(a, 'ao')
0038 
0039   d = a.data;
0040 
0041   [x,y] = get_xy_values(a.data);
0042 
0043   if isreal(y)
0044     out = [x y];
0045   else
0046     out = [x real(y) imag(y)];
0047   end
0048 
0049   save(fname, 'out', '-ASCII', '-DOUBLE', '-TABS');
0050 
0051 else
0052   error('### incorrect usage: first argument should be an AO.');
0053 end
0054 
0055 % END
0056

Generated on Fri 07-Mar-2008 15:46:43 by m2html © 2003