Mercurial > hg > ltpda
diff m-toolbox/classes/@minfo/setMpackage.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@minfo/setMpackage.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,32 @@ +% SETMPACKAGE Set the property 'mpackage'. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: Set the property 'mpackage'. +% +% CALL: obj.setMpackage('string'); +% obj = obj.setMpackage('string'); +% +% INPUTS: obj - must be a single minfo object. +% +% VERSION: $Id: setMpackage.m,v 1.1 2011/04/17 09:21:29 hewitson Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = setMpackage(varargin) + + obj = varargin{1}; + val = varargin{2}; + + if ~ischar(val) + error('### The value for the property ''mpackage'' must be a string but it is from the class [%s]!', class(val)); + end + + %%% decide whether we modify the minfo-object, or create a new one. + obj = copy(obj, nargout); + + %%% set 'mclass' + obj.mpackage = val; + + varargout{1} = obj; +end +