comparison m-toolbox/classes/@data2D/getX.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 % GETX Get the property 'x'.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: Get the property 'x'.
5 %
6 % CALL: val = obj.getX();
7 % val = obj.getX(idx);
8 % val = obj.getX(1:10);
9 %
10 % INPUTS: obj - must be a single data2D object.
11 % idx - index of the data samples
12 %
13 % VERSION: $Id: getX.m,v 1.9 2011/03/21 14:55:48 mauro Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function out = getX(data,idx)
18
19 % Get x values
20 out = data.x;
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