diff m-toolbox/test/test_ao_hist.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_ao_hist.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,44 @@
+% TEST_AO_HIST tests the histogram function of the AO class.
+%
+% M Hewitson 24-05-07
+%
+% $Id: test_ao_hist.m,v 1.8 2009/02/02 15:20:37 hewitson Exp $
+%
+function test_ao_hist()
+  
+  
+  % Make some time-series data
+  nsecs = 1000;
+  fs    = 100;
+  pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))');
+  a1 = ao(pl);
+  
+  % Make some frequency series data
+  a2 = psd(a1);
+  
+  % Make some cdata
+  a3 = ao(randn(nsecs*fs,1));
+  
+  % Make histograms
+  s1 = a1 + a3;
+  h1 = hist(a1,plist('N', 100));
+  h2 = hist(a2,plist('N', 100));
+  
+  h3 = hist(a3,plist('N', 100));
+  h4 = hist(a3,plist('X', h3.data.x));
+  h5 = hist(s1,plist('N', 100));
+  
+  % Plot
+  pl = plist('Function', 'stairs');
+  iplot(h5, pl)
+  plot(h5.hist)
+  
+  iplot(h1, pl)
+  iplot(h2, pl)
+  iplot(h3, pl)
+  iplot(h4, pl)
+  iplot(h5, pl)
+  
+  
+end
+% END