comparison m-toolbox/classes/@data2D/getDx.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 % GETDX Get the property 'dx'.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: Get the property 'dx'.
5 %
6 % CALL: val = obj.getDx();
7 % val = obj.getDx(idx);
8 % val = obj.getDx(1:10);
9 %
10 % INPUTS: obj - must be a single data2D object.
11 % idx - index of the data samples
12 %
13 % VERSION: $Id: getDx.m,v 1.4 2011/03/21 14:55:48 mauro Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function out = getDx(data,idx)
18
19 % Get dx values
20 out = data.dx;
21
22 % Decide if the user wants all data
23 if nargin == 1
24 % Make sure we output a column
25 if size(out,1) == 1
26 out = out.';
27 end
28 else
29 if size(out,1) == 1
30 % Make sure we output a column
31 out = out(idx).';
32 else
33 out = out(idx);
34 end
35 end
36 end
37