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

📄 tan.m

📁 matlab波形优化算法经常要用到的matlab toolbox工具箱:yalmip
💻 M
字号:
function varargout = tan (varargin)
%TAN (overloaded)

% Author Johan L鰂berg
% $Id: tan.m,v 1.10 2007/08/02 18:16:26 joloef Exp $

switch class(varargin{1})

    case 'double'
        error('Overloaded SDPVAR/TAN CALLED WITH DOUBLE. Report error')

    case 'sdpvar'
        varargout{1} = InstantiateElementWise(mfilename,varargin{:});

    case 'char'

        operator = struct('convexity','none','monotonicity','none','definiteness','none','model','callback');
        operator.convexhull = [];
        operator.bounds = @bounds;
        operator.derivative = @(x)(-1./cos(x));

        varargout{1} = [];
        varargout{2} = operator;
        varargout{3} = varargin{3};

    otherwise
        error('SDPVAR/TAN called with CHAR argument?');
end


function [L,U] = bounds(xL,xU)
n1 = fix((xL+pi/2)/(pi));
n2 = fix((xU+pi/2)/(pi));
if n1==n2
    L = tan(xL);
    U = tan(xU);
else
    L = -inf;
    U = inf;
end

⌨️ 快捷键说明

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