inherit.m

来自「任意边界结构正交曲线网格生成程序」· M 代码 · 共 43 行

M
43
字号
function [varargout] = inherit(theMethod, self, varargin)% inherit -- Inherit a superclass method.%  [varargout] = inherit('theMethod', self, varargin) calls%   the superclass 'method' of self, an object, with the%   given input and output arguments.  The routine%   climbs the inheritance tree if needed.  (Multiple%   inheritance is not supported here.) % Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%  All Rights Reserved.%   Disclosure without explicit written consent from the%    copyright owner does not constitute publication. % Version of 07-Dec-1999 22:50:19.% Updated    08-Dec-1999 11:31:36.if nargin < 2, help(mfilename), return, endif ~isobject(self), return, end% Clean up the name of the method.f = find(theMethod =='/');if any(f), theMethod(1:f(end)) = ''; endtheSuperObject = super(self);varargout = cell(1, nargout);varargin = [{theMethod}; varargin(:)];while isobject(theSuperObject)	varargin{1} = theSuperObject;	try		if nargout > 0			[varargout{:}] = feval(theMethod, varargin{:});		else			feval(theMethod, varargin{:})		end	catch	end   theSuperObject = super(theSuperObject);end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?