Mercurial > hg > ltpda
diff m-toolbox/classes/@history/setObjectClass.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/@history/setObjectClass.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,36 @@ +% SETOBJECTCLASS set the class of object that this history refers to. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: SETOBJECTCLASS set the class of object that this history +% refers to. +% +% CALL: h = setObjectClass(h, class); +% h.setObjectClass(class); +% +% INPUT: h - history object +% class - string with the class name. +% +% VERSION: $Id: setObjectClass.m,v 1.1 2010/08/18 15:15:27 ingo Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = setObjectClass(varargin) + + % Check the inputs + if nargin ~= 2 + error('### This method accepts only one history object and one class name.'); + end + + h = varargin{1}; + cl = varargin{2}; + + % Decide on a deep copy or a modify + h = copy(h, nargout); + + % Set the class name to the history object + h.objectClass = cl; + + % Define the output + varargout{1} = h; + +end