Changeset 28230
- Timestamp:
- 04/19/24 09:33:07 (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/pairoptions.m
r27401 r28230 7 7 classdef pairoptions < matlab.mixin.Copyable 8 8 properties (SetAccess = private,GetAccess = private) 9 functionname = ''; 10 list = cell(0,3); 9 list = cell(0,3); 11 10 end 12 11 methods 13 12 function self = pairoptions(varargin) % {{{ 14 13 15 %get calling function name16 a=dbstack;17 if length(a)>1,18 self.functionname=a(2).file(1:end-2);19 else20 self.functionname='';21 end22 23 14 %initialize list 24 15 if nargin==0, … … 32 23 33 24 %check length of input 34 if mod((nargin-1),2) ,25 if mod((nargin-1),2) 35 26 error('Invalid parameter/value pair arguments') 36 27 end … … 41 32 42 33 %go through varargin and build list of obj 43 for i=1:numoptions ,44 if ischar(varargin{2*i-1}) ,34 for i=1:numoptions 35 if ischar(varargin{2*i-1}) 45 36 self.list{i,1}=varargin{2*i-1}; 46 37 self.list{i,2}=varargin{2*i}; … … 132 123 end % }}} 133 124 function disp(self) % {{{ 134 disp(sprintf(' functionname: %s',self.functionname));135 125 if ~isempty(self.list), 136 126 disp(sprintf(' list: (%ix%i)\n',size(self.list,1),size(self.list,2)));
Note:
See TracChangeset
for help on using the changeset viewer.