comparison m-toolbox/classes/@plist/getDefaultAxisPlist.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 % GETDEFAULTAXISPLIST returns the default plist for the axis key based on
2 % the input set.
3 %
4 % CALL:
5 % pl = plist.getDefaultAxisPlist(set)
6 %
7 % Supported sets: '1D', '2D', '3D'
8 %
9 % VERSION $Id: getDefaultAxisPlist.m,v 1.2 2011/04/19 16:20:21 ingo Exp $
10 %
11 function plout = getDefaultAxisPlist(varargin)
12
13 if nargin == 0
14 set = '';
15 else
16 set = varargin{1};
17
18 if ~ischar(varargin{1})
19 error('Incorrect usage: the set needs to be a string.');
20 end
21 end
22
23 % persistent pl;
24 % persistent lastset;
25 % if exist('pl', 'var')==0 || isempty(pl) || ~strcmp(lastset, set)
26 pl = buildplist(set);
27 % lastset = set;
28 % end
29 plout = pl;
30
31 end
32
33 function pl = buildplist(set)
34
35 switch set
36 case '1D'
37 pl = plist.AXIS_1D_PLIST;
38 case '2D'
39 pl = plist.AXIS_2D_PLIST;
40 case '3D'
41 pl = plist.AXIS_3D_PLIST;
42 case ''
43 pl = plist.AXIS_3D_PLIST;
44 otherwise
45 error('Unsupported set for default axis plist [%s]', set);
46 end
47
48 end