view m-toolbox/classes/@minfo/setMclass.m @ 44:409a22968d5e
default
Add unit tests
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Tue, 06 Dec 2011 18:42:11 +0100 (2011-12-06)
parents
f0afece42f48
children
line source
+ − % SETMCLASS Set the property 'mclass'.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: Set the property 'mclass'.
+ − %
+ − % CALL: obj.setMclass('string');
+ − % obj = obj.setMclass('string');
+ − %
+ − % INPUTS: obj - must be a single minfo object.
+ − %
+ − % VERSION: $Id: setMclass.m,v 1.1 2010/03/25 15:16:13 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function varargout = setMclass(varargin)
+ −
+ − obj = varargin{1};
+ − val = varargin{2};
+ −
+ − if ~ischar(val)
+ − error('### The value for the property ''mclass'' 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.mclass = val;
+ −
+ − varargout{1} = obj;
+ − end
+ −