Mercurial > hg > ltpda
diff m-toolbox/test/test_split_chunks.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/test_split_chunks.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,47 @@ +% function a_out = test_ao_split_chunks +% Test AO split. +% +% M Hewitson 23-02-08 +% +% $Id: test_split_chunks.m,v 1.1 2008/02/23 16:34:19 hewitson Exp $ +% + +% Test AO + +a1 = ao(plist('tsfcn', 'sin(2*pi*0.1*t)', 'nsecs', 100, 'fs', 10)); + +% Split into chunks +as = split(a1, plist('split_type', 'chunks', 'N', 10)); + +% Plot chunks +iplot(as, plist('Markers', {'All', 'o'})) + +b = join(as); +figure +plot(b.hist); + +iplot(a1, b) +iplot(a1./b); + +return + +%% Recreate from history + +% Write an m-file from AO +ao2m(b, 'ltpda_test.m'); + +% now run it +clear all +a_out = ltpda_test; + +iplot(a_out) +figure +plot(a_out.hist) + +%% Delete test files +% delete('ltpda_test.m'); + + + + +