Mercurial > hg > ltpda
comparison m-toolbox/classes/@tsdata/evenly.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 % EVENLY defines if the data is evenly sampled or not | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: | |
5 % | |
6 % CALL: evenly = evenly(data) | |
7 % | |
8 % INPUTS: tsdata - a tsdata object | |
9 % | |
10 % OUTPUTS: evenly - signals whether the data is regularly sampled or not | |
11 % | |
12 % VERSION: $Id: evenly.m,v 1.1 2010/04/30 14:56:30 nicolodi Exp $ | |
13 % | |
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
15 | |
16 function evenly = evenly(data) | |
17 | |
18 % if the x vector has a null dimension ether the tsdata is empty or | |
19 % the x vector has been collapsed. in those cases the data is | |
20 % assumed to be evenly sampled | |
21 if isempty(data.x) | |
22 evenly = true; | |
23 return; | |
24 end | |
25 | |
26 % otherwise we fall back to the fitfs method | |
27 [fs, t0, uneven] = tsdata.fitfs(data.x); | |
28 evenly = ~uneven; | |
29 | |
30 end | |
31 |