view m-toolbox/classes/@ltpda_data/getY.m @ 44:409a22968d5e
default
Add unit tests
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Tue, 06 Dec 2011 18:42:11 +0100 (2011-12-06)
parents
f0afece42f48
children
line source
+ − % GETY Get the property 'y'.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: Get the property 'y'.
+ − %
+ − % CALL: val = obj.getY();
+ − % val = obj.getY(idx);
+ − % val = obj.getY(1:10);
+ − %
+ − % INPUTS: obj - must be a single ltpda_data (cdata, data2D, data3D) object.
+ − % idx - index of the data samples
+ − %
+ − % VERSION: $Id: getY.m,v 1.3 2011/03/21 14:54:32 mauro Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function out = getY(data,idx)
+ −
+ − % Get y values
+ − out = data.y;
+ −
+ − % Decide if the user wants all data
+ − if nargin == 1
+ − % Make sure we output a column
+ − if size(out,1) == 1
+ − out = out.';
+ − end
+ − else
+ − if size(out,1) == 1
+ − % Make sure we output a column
+ − out = out(idx).';
+ − else
+ − out = out(idx);
+ − end
+ − end
+ − end
+ −