view m-toolbox/test/testing_xml.m @ 18:947e2ff4b1b9 database-connection-manager

Update plist.FROM_REPOSITORY_PLIST and plist.TO_REPOSITORY_PLIST
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +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