diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/test/illegal_function.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,41 @@
+function varargout = illegal_function(varargin)
+
+% An illegal function which is not part of LTPDA but works on AOs.
+% 
+
+
+ALGONAME = mfilename;
+VERSION  = '$Id: illegal_function.m,v 1.1 2008/02/22 18:41:52 hewitson Exp $';
+
+% Collect input ao's, plist's and ao variable names
+in_names = {};
+for ii = 1:nargin
+  in_names{end+1} = inputname(ii);
+end
+
+[as, ps, invars] = collect_inputs(varargin, in_names);
+
+a     = as(1);
+d     = get(a, 'data');
+dinfo = whos('d');
+
+% make a new fsdata object
+nfft = length(d.y);
+ft   = fft(d.y);
+ft   = ft(1:nfft/2+1);
+f    = linspace(0, d.fs/2, length(ft));
+fsd = fsdata(f, ft, d.fs);
+fsd = set(fsd, 'name', sprintf('illegal_function(%s)', d.name));
+fsd = set(fsd, 'xunits', 'Hz');
+fsd = set(fsd, 'yunits', '');
+
+% make a new history object
+h = history(ALGONAME, VERSION, plist(), [a.hist]);
+h = set(h, 'invars', cellstr(invars{1}));
+
+% make output analysis object
+b = ao(fsd, h);
+b = setnh(b, 'name', sprintf('illegal_function(%s)', invars{1}));
+
+
+varargout{1} = b;