⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 optset.m

📁 GMM工具箱
💻 M
字号:
% OPTSET Utility to set function options 
% USAGE
%   optset(funcname,optname,optvalue)
% INPUTS
%   funcname : name of function
%   optname  : name of option
%   optval   : option value
%
% If optname='defaults' the current setting of the options will be
%    cleared. The next time the function is called, the default
%    options will be restored.

% Copyright (c) 1997-2002, Paul L. Fackler & Mario J. Miranda
% paul_fackler@ncsu.edu, miranda.4@osu.edu

function optset(funcname,optname,optvalue)

optvar = [lower(funcname) '_options'];   % name of global variable
optname  = lower(optname);               % name of option field
if strcmp(optname,'defaults')
  eval(['clear global  ' optvar])        % clears global variable
else
  eval(['global  ' optvar])                % declare global variable
  eval([optvar '.' optname '=optvalue;'])  % set specified field
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -