www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimoptions/setDescription.m
function obj = setDescription(obj, sDesc) %SETDESCRIPTION Provide a description for the optimization function. % OPTIONS = SETDESCRIPTION(OPTIONS, DESC) sets the description for the % optimization object to be the string DESC. % % See also CGOPTIMOPTIONS/GETDESCRIPTION. % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin < 2 error(message('mbc:cgoptimoptions:InvalidArgument21')); end % Check input types [ok, msg] = i_CheckInputs({sDesc}); if ~ok error('mbc:cgoptimoptions:InvalidArgument22', msg); end obj.description = sDesc; %---------------------------------------------------------------------- function [ok, msg] = i_CheckInputs(in) %---------------------------------------------------------------------- ok = false; msg = ''; if ~ischar(in{1}) msg = 'The description must be a string.'; else ok = true; end