Mercurial > hg > ltpda
diff m-toolbox/test/make_test_ascii_file.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/make_test_ascii_file.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,20 @@ +function make_test_ascii_file(name, Nsecs, fs) + +% Make a test ascii file with the name 'name.txt' containing a time-series +% of random noise, N seconds long sampled at fs Hz. +% +% >> make_test_ascii_file(name, Nsecs, fs) +% +% M Hewitson 01-02-07 +% +% $Id: make_test_ascii_file.m,v 1.3 2007/02/11 19:51:11 hewitson Exp $ +% + +% create test data +t = linspace(0, Nsecs-1/fs, Nsecs*fs); +x = randn(1,Nsecs*fs) + 2*sin(2*pi*45.*t); +out = [t;x].'; + +% Save data as ascii file +filename = sprintf('%s.txt', name); +save(filename, 'out', '-ASCII', '-DOUBLE', '-TABS');