Implements the time within the family of Expressions. Usage: >> TIME(t); >> TIME t; SHORTHAND Parameters: name A valid matlab variable name [STRING] Example: >> TIME t; Licence: This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/) ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven. Developed within the Optimization in Engineering Center (OPTEC) under supervision of Moritz Diehl. All rights reserved. ACADO Toolkit is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ACADO Toolkit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with ACADO Toolkit; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Author: David Ariens Date: 2010
0001 %Implements the time within the family of Expressions. 0002 % 0003 % Usage: 0004 % >> TIME(t); 0005 % >> TIME t; SHORTHAND 0006 % 0007 % Parameters: 0008 % name A valid matlab variable name [STRING] 0009 % 0010 % Example: 0011 % >> TIME t; 0012 % 0013 % Licence: 0014 % This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/) 0015 % 0016 % ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. 0017 % Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven. 0018 % Developed within the Optimization in Engineering Center (OPTEC) under 0019 % supervision of Moritz Diehl. All rights reserved. 0020 % 0021 % ACADO Toolkit is free software; you can redistribute it and/or 0022 % modify it under the terms of the GNU Lesser General Public 0023 % License as published by the Free Software Foundation; either 0024 % version 3 of the License, or (at your option) any later version. 0025 % 0026 % ACADO Toolkit is distributed in the hope that it will be useful, 0027 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0028 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0029 % Lesser General Public License for more details. 0030 % 0031 % You should have received a copy of the GNU Lesser General Public 0032 % License along with ACADO Toolkit; if not, write to the Free Software 0033 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0034 % 0035 % Author: David Ariens 0036 % Date: 2010 0037 % 0038 classdef TIME < acado.Expression 0039 properties(SetAccess='protected') 0040 0041 end 0042 0043 methods 0044 function obj = TIME(varargin) 0045 global ACADO_; 0046 0047 if (nargin == 2) 0048 if (isvarname(varargin{1}) ~= 1) 0049 error( 'ERROR: The variable name you have set is not a valid matlab variable name. A valid variable name is a character string of letters, digits, and underscores, totaling not more than namelengthmax characters and beginning with a letter.' ); 0050 end 0051 0052 obj.name = varargin{1}; 0053 ACADO_.helper.addT(obj); 0054 0055 elseif (nargin == 1) 0056 if (isvarname(varargin{1}) ~= 1) 0057 error( 'ERROR: The variable name you have set is not a valid matlab variable name. A valid variable name is a character string of letters, digits, and underscores, totaling not more than namelengthmax characters and beginning with a letter.' ); 0058 end 0059 0060 obj.name = varargin{1}; 0061 ACADO_.helper.addT(obj); 0062 ACADO_.helper.addInstruction(obj); 0063 0064 else 0065 obj.name = 'autoTIME'; 0066 ACADO_.helper.addT(obj); 0067 ACADO_.helper.addInstruction(obj); 0068 end 0069 0070 0071 end 0072 0073 getInstructions(obj, cppobj, get) 0074 0075 end 0076 0077 end 0078