view m-toolbox/test/testing_xml.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

% Test saving AO to xml
%
%
% $Id: testing_xml.m,v 1.23 2009/07/21 05:16:29 hewitson Exp $
%
function testing_xml()
  
  
  % Make test AOs
  nsecs = 10;
  fs    = 1000;
  
  pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))');
  
  a1 = ao(pl);
  a2 = ao(pl);
  
  % Make LPSD of each
  
  % Window function
  w = specwin('Kaiser', 1000, 250);
  
  % use lpsd
  a3 = psd(a1);
  a4 = psd(a2);
  
  % multiply
  a5 = a3.*a4;
  iplot(a5)
  plot(a5.hist)
  
  % Save to XML
  file_name = 'a5.xml';
  save(a5, file_name);
  
  % Load
  file_name = 'a5.xml';
  b = ao(file_name);
  iplot(b)
  plot(b.hist)
  
  % Rebuild from history
  a_out = rebuild(b);
  plot(a_out.hist)
  iplot(a_out)
  
end