Mercurial > hg > ltpda
comparison m-toolbox/classes/@cdata/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 cdata-object into a string. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: CHAR convert a cdata object into a string. | |
5 % | |
6 % CALL: string = char(fsdata) | |
7 % | |
8 % VERSION: $Id: char.m,v 1.12 2011/02/18 16:48:51 ingo Exp $ | |
9 % | |
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | |
12 function varargout = char(varargin) | |
13 | |
14 % Collect all cdata-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 pstr(end) = ')'; | |
41 | |
42 varargout{1} = pstr; | |
43 end | |
44 |