comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function make_test_ascii_file(name, Nsecs, fs)
2
3 % Make a test ascii file with the name 'name.txt' containing a time-series
4 % of random noise, N seconds long sampled at fs Hz.
5 %
6 % >> make_test_ascii_file(name, Nsecs, fs)
7 %
8 % M Hewitson 01-02-07
9 %
10 % $Id: make_test_ascii_file.m,v 1.3 2007/02/11 19:51:11 hewitson Exp $
11 %
12
13 % create test data
14 t = linspace(0, Nsecs-1/fs, Nsecs*fs);
15 x = randn(1,Nsecs*fs) + 2*sin(2*pi*45.*t);
16 out = [t;x].';
17
18 % Save data as ascii file
19 filename = sprintf('%s.txt', name);
20 save(filename, 'out', '-ASCII', '-DOUBLE', '-TABS');