Mercurial > hg > ltpda
comparison m-toolbox/classes/@matrix/ncols.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 % NCOLS Returns the number of columns of the inner object array. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: Returns the number of columns of the inner object array. | |
5 % | |
6 % CALL: m = ncols(matrix-object); | |
7 % m = matrix.ncols(); | |
8 % | |
9 % <a href="matlab:utils.helper.displayMethodInfo('matrix', 'ncols')">Parameters Description</a> | |
10 % | |
11 % VERSION: $Id: ncols.m,v 1.7 2011/04/08 08:56:31 hewitson Exp $ | |
12 % | |
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
14 | |
15 function varargout = ncols(varargin) | |
16 | |
17 % Check if this is a call for parameters | |
18 if utils.helper.isinfocall(varargin{:}) | |
19 varargout{1} = getInfo(varargin{3}); | |
20 return | |
21 end | |
22 | |
23 % Collect all AOs | |
24 ms = utils.helper.collect_objects(varargin(:), 'matrix'); | |
25 | |
26 if numel(ms) ~= 1 | |
27 error('### This method can only handle one matrix object but there are [%d] objects.', numel(ms)); | |
28 end | |
29 | |
30 varargout{1} = size(ms.objs,2); | |
31 | |
32 end | |
33 | |
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
35 % Local Functions % | |
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
37 | |
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
39 % | |
40 % FUNCTION: getInfo | |
41 % | |
42 % DESCRIPTION: Get Info Object | |
43 % | |
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
45 | |
46 function ii = getInfo(varargin) | |
47 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
48 sets = {}; | |
49 pl = []; | |
50 else | |
51 sets = {'Default'}; | |
52 pl = getDefaultPlist; | |
53 end | |
54 % Build info object | |
55 ii = minfo(mfilename, 'matrix', 'ltpda', utils.const.categories.helper, '$Id: ncols.m,v 1.7 2011/04/08 08:56:31 hewitson Exp $', sets, pl); | |
56 end | |
57 | |
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
59 % | |
60 % FUNCTION: getDefaultPlist | |
61 % | |
62 % DESCRIPTION: Get Default Plist | |
63 % | |
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
65 | |
66 function plout = getDefaultPlist() | |
67 persistent pl; | |
68 if exist('pl', 'var')==0 || isempty(pl) | |
69 pl = buildplist(); | |
70 end | |
71 plout = pl; | |
72 end | |
73 | |
74 function pl = buildplist() | |
75 pl = plist.EMPTY_PLIST; | |
76 end | |
77 |