comparison m-toolbox/classes/@data2D/char.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 % CHAR convert a ltpda_data-object into a string.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CHAR convert a ltpda_data object into a string.
5 %
6 % CALL: string = char(fsdata)
7 %
8 % VERSION: $Id: char.m,v 1.8 2011/06/15 11:25:01 hewitson Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function varargout = char(varargin)
13
14 % Collect all ltpda_data-objects
15 objs = [varargin{:}];
16
17 %%% Add the size of the data (all)
18 pstr = sprintf('Ndata=[%sx%s],', num2str(size(objs.y,1)), num2str(size(objs.y,2)));
19
20 %%% Add the sample rate of data (tsdata, fsdata)
21 if isprop(objs, 'fs')
22 pstr = sprintf('%s fs=%g,', pstr, objs.fs);
23 end
24
25 %%% Add the length of this time-series in seconds (tsdata)
26 if isprop(objs, 'nsecs')
27 pstr = sprintf('%s nsecs=%d,', pstr, objs.nsecs);
28 end
29
30 %%% Add number of averages (fsdata)
31 if isprop(objs, 'navs')
32 pstr = sprintf('%s navs=%d,', pstr, objs.navs);
33 end
34
35 %%% Add time-stamp of the first data sample (fsdata, tsdata)
36 if isprop(objs, 't0')
37 pstr = sprintf('%s t0=%s,', pstr, char(objs.t0));
38 end
39
40 %%% Add time-stamp of the first data sample (fsdata, tsdata)
41 if isprop(objs, 'yunits')
42 pstr = sprintf('%s yunits=%s,', pstr, char(objs.yunits));
43 end
44
45 pstr = pstr(1:end-1);
46
47 varargout{1} = pstr;
48 end
49