Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/mrdivide.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 % MRDIVIDE implements mrdivide operator for analysis objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: MRDIVIDE implements mrdivide operator for analysis objects. | |
5 % For AOs, this is taken to be identical to ./ (rdivide). | |
6 % | |
7 % CALL: a = a1/scalar | |
8 % a = a1/a2 | |
9 % | |
10 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'mrdivide')">Parameters Description</a> | |
11 % | |
12 % VERSION: $Id: mrdivide.m,v 1.37 2011/04/08 08:56:16 hewitson Exp $ | |
13 % | |
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
15 | |
16 function varargout = mrdivide(varargin) | |
17 | |
18 % Settings | |
19 op = 'rdivide'; | |
20 opname = 'matrix divide'; | |
21 opsym = '/'; | |
22 | |
23 if nargout == 0 | |
24 error('### A %s operator can not be used as a modifier.', opname); | |
25 end | |
26 | |
27 callerIsMethod = utils.helper.callerIsMethod; | |
28 | |
29 if callerIsMethod | |
30 aosNames = {}; | |
31 else | |
32 % collect input variable names | |
33 for ii = 1:nargin,aosNames{ii} = inputname(ii);end | |
34 end | |
35 | |
36 % apply operator | |
37 res = ao.elementOp(callerIsMethod, @getInfo, @getDefaultPlist, op, opname, opsym, aosNames, varargin(:)); | |
38 | |
39 % Set output | |
40 varargout = utils.helper.setoutputs(nargout, res); | |
41 | |
42 end | |
43 | |
44 %-------------------------------------------------------------------------- | |
45 % Get Info Object | |
46 %-------------------------------------------------------------------------- | |
47 function ii = getInfo(varargin) | |
48 | |
49 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
50 sets = {}; | |
51 pls = []; | |
52 else | |
53 sets = {'Default'}; | |
54 pls = getDefaultPlist; | |
55 end | |
56 % Build info object | |
57 ii = minfo(mfilename, 'ao', 'ltpda', utils.const.categories.aop, '$Id: mrdivide.m,v 1.37 2011/04/08 08:56:16 hewitson Exp $', sets, pls); | |
58 ii.setArgsmin(2); | |
59 end | |
60 | |
61 %-------------------------------------------------------------------------- | |
62 % Get Default Plist | |
63 %-------------------------------------------------------------------------- | |
64 function plout = getDefaultPlist() | |
65 persistent pl; | |
66 if ~exist('pl', 'var') || isempty(pl) | |
67 pl = buildplist(); | |
68 end | |
69 plout = pl; | |
70 end | |
71 | |
72 function pl = buildplist() | |
73 pl = plist.EMPTY_PLIST; | |
74 end |