0001 function export(a, fname)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 if isa(a, 'ao')
0013
0014 d = a.data;
0015 if isa(d, 'cdata')
0016
0017 vals = get(d, 'vals');
0018 n = 1:length(vals);
0019 out = [n vals];
0020 save(fname, 'out', '-ASCII', '-DOUBLE', '-TABS');
0021
0022 elseif isa(d, 'fsdata')
0023
0024 xx = get(d, 'xx');
0025 f = get(d, 'f');
0026 if isreal(xx)
0027 out = [f xx];
0028 else
0029 out = [f real(xx) imag(xx)];
0030 end
0031 save(fname, 'out', '-ASCII', '-DOUBLE', '-TABS');
0032
0033 elseif isa(d, 'tsdata')
0034
0035 x = get(d, 'x');
0036 t = get(d, 't');
0037 out = [t x];
0038 save(fname, 'out', '-ASCII', '-DOUBLE', '-TABS');
0039
0040 else
0041 error('### unknown AO data type.');
0042 end
0043
0044 else
0045 error('### incorrect usage: first argument should be an AO.');
0046 end
0047
0048
0049
0050