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