Mercurial > hg > ltpda
diff m-toolbox/classes/@data3D/getZ.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@data3D/getZ.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,35 @@ +% GETZ Get the property 'z'. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: Get the property 'z'. +% +% CALL: val = obj.getZ(); +% val = obj.getZ(idx); +% val = obj.getZ(idx1, idx2); +% val = obj.getZ(1:10); +% val = obj.getZ(1,:); +% +% INPUTS: obj - must be a single data3D object. +% idx - index of the data samples +% +% VERSION: $Id: getZ.m,v 1.9 2011/03/21 15:47:29 mauro Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = getZ(data,idx1,idx2) + + % get z values + out = data.z; + + % Decide if the user wants all data + switch nargin + case 2 + out = out(idx1); + case 3 + out = out(idx1, idx2); + end + + varargout{1} = out; + +end +