comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % SETOBJECTCLASS set the class of object that this history refers to.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: SETOBJECTCLASS set the class of object that this history
5 % refers to.
6 %
7 % CALL: h = setObjectClass(h, class);
8 % h.setObjectClass(class);
9 %
10 % INPUT: h - history object
11 % class - string with the class name.
12 %
13 % VERSION: $Id: setObjectClass.m,v 1.1 2010/08/18 15:15:27 ingo Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function varargout = setObjectClass(varargin)
18
19 % Check the inputs
20 if nargin ~= 2
21 error('### This method accepts only one history object and one class name.');
22 end
23
24 h = varargin{1};
25 cl = varargin{2};
26
27 % Decide on a deep copy or a modify
28 h = copy(h, nargout);
29
30 % Set the class name to the history object
31 h.objectClass = cl;
32
33 % Define the output
34 varargout{1} = h;
35
36 end