comparison m-toolbox/test/illegal_function.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function varargout = illegal_function(varargin)
2
3 % An illegal function which is not part of LTPDA but works on AOs.
4 %
5
6
7 ALGONAME = mfilename;
8 VERSION = '$Id: illegal_function.m,v 1.1 2008/02/22 18:41:52 hewitson Exp $';
9
10 % Collect input ao's, plist's and ao variable names
11 in_names = {};
12 for ii = 1:nargin
13 in_names{end+1} = inputname(ii);
14 end
15
16 [as, ps, invars] = collect_inputs(varargin, in_names);
17
18 a = as(1);
19 d = get(a, 'data');
20 dinfo = whos('d');
21
22 % make a new fsdata object
23 nfft = length(d.y);
24 ft = fft(d.y);
25 ft = ft(1:nfft/2+1);
26 f = linspace(0, d.fs/2, length(ft));
27 fsd = fsdata(f, ft, d.fs);
28 fsd = set(fsd, 'name', sprintf('illegal_function(%s)', d.name));
29 fsd = set(fsd, 'xunits', 'Hz');
30 fsd = set(fsd, 'yunits', '');
31
32 % make a new history object
33 h = history(ALGONAME, VERSION, plist(), [a.hist]);
34 h = set(h, 'invars', cellstr(invars{1}));
35
36 % make output analysis object
37 b = ao(fsd, h);
38 b = setnh(b, 'name', sprintf('illegal_function(%s)', invars{1}));
39
40
41 varargout{1} = b;