Mercurial > hg > ltpda
comparison m-toolbox/classes/@data3D/setZunits.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 % SETZUNITS Set the property 'zunits'. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: Set the property 'zunits'. | |
5 % | |
6 % CALL: obj.setZunits('units'); | |
7 % obj = obj.setZunits('units'); create copy of the object | |
8 % | |
9 % INPUTS: obj - must be a single data3D object. | |
10 % units - unit object or a valid string which can be transformed | |
11 % into a unit object. | |
12 % | |
13 % VERSION: $Id: setZunits.m,v 1.8 2011/07/12 13:35:02 mauro Exp $ | |
14 % | |
15 % | |
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
17 | |
18 function varargout = setZunits(varargin) | |
19 | |
20 obj = varargin{1}; | |
21 val = varargin{2}; | |
22 | |
23 % decide whether we modify the object, or create a new one. | |
24 obj = copy(obj, nargout); | |
25 | |
26 % set 'zunits' | |
27 if isempty(val) | |
28 obj.zunits = unit(); | |
29 elseif ischar(val) | |
30 obj.zunits = unit(val); | |
31 elseif iscell(val) | |
32 obj.zunits = val{1}; | |
33 else | |
34 obj.zunits = val; | |
35 end | |
36 | |
37 varargout{1} = obj; | |
38 end | |
39 |