0001 function bs = conj(varargin)
0002
0003
0004
0005
0006
0007
0008
0009 invars = {};
0010 for j=1:nargin
0011 invars = [invars cellstr(inputname(j))];
0012 end
0013
0014 ALGONAME = mfilename;
0015 VERSION = '$Id: conj.html,v 1.1 2007/06/08 14:15:02 hewitson Exp $';
0016
0017 as = [];
0018 for j=1:nargin
0019 a = varargin{j};
0020 if isa(a, 'ao')
0021 as = [as a];
0022 end
0023 end
0024
0025
0026 pl = plist();
0027
0028 bs = [];
0029
0030 for j=1:length(as)
0031 a = as(j);
0032
0033 d = get(a, 'data');
0034 dinfo = whos('d');
0035
0036 dtype = dinfo.class;
0037 switch dtype
0038 case 'tsdata'
0039 disp('* conjugate of tsdata object');
0040
0041
0042 [h, ts] = single_operation(d, 'conj', pl);
0043
0044 ts = set(ts, 'name', sprintf('conj(%s)', d.name));
0045 ts = set(ts, 'xunits', d.xunits);
0046 ts = set(ts, 'yunits', d.yunits);
0047 ts = set(ts, 't0', d.t0);
0048
0049
0050
0051
0052 h = set(h, 'invars', [a.hist]);
0053 b = ao(ts, h);
0054 b = set(b, 'name', sprintf('conj(%s)', char(invars{1})));
0055
0056 case 'fsdata'
0057 disp('* conjugate of fsdata object');
0058
0059 [h, fs] = single_operation(d, 'conj', pl);
0060
0061 fs = set(fs, 'name', sprintf('conj(%s)', d.name));
0062 fs = set(fs, 'xunits', d.xunits);
0063 fs = set(fs, 'yunits', d.yunits);
0064 fs = set(fs, 'enbw', d.enbw);
0065
0066
0067
0068
0069 h = set(h, 'invars', [a.hist]);
0070
0071 if isempty(char(invars{1}))
0072 n1 = a.name;
0073 else
0074 n1 = char(invars{1});
0075 end
0076 b = ao(fs, h);
0077 b = set(b, 'name', ['conj(' n1 ')'] );
0078 case 'cdata'
0079 disp('* conjugate of cdata object');
0080
0081 [h, c] = single_operation(d, 'conj', pl);
0082
0083
0084 h = set(h, 'invars', [a.hist]);
0085 b = ao(c, h);
0086 b = set(b, 'name', sprintf('conj(%s)', char(invars{1})));
0087 otherwise
0088 error('### unknown data type. They can not be addded.')
0089 end
0090
0091
0092 bs = [bs b];
0093
0094 end
0095