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

📄 getvariables.m

📁 国外专家做的求解LMI鲁棒控制的工具箱,可以相对高效的解决LMI问题
💻 M
字号:
function varargout = getvariables(X,whatvars)
%GETVARIABLES Returns variable indicies to variables used in a SDPVAR object
%
% i = getvariables(x)
%
% Input
%    x : SDPVAR object
% Output
%    i : DOUBLE
%
% Note : The difference compared DEPENDS is that nonlinear terms
%        are reported as separate variables.

% Author Johan L鰂berg
% $Id: getvariables.m,v 1.3 2004/10/04 07:51:13 johanl Exp $

switch nargin
    case 1
        varargout{1} = X.lmi_variables;
    case 2
        [sqrList,CompressedList] = yalmip('nonlinearvariables');
        used_variables = getvariables(X);
        if isempty(sqrList)
            LinearVariables = used_variables;
            NonlinearVariables=[];
        else
            LinearVariables    = setdiff(used_variables,sqrList(:,1));
            NonlinearVariables = setdiff(used_variables,LinearVariables);
        end
        switch whatvars
            case 'linear'
                varargout{1} = LinearVariables;
            case 'nonlinear'
                varargout{1} = NonlinearVariables;
            case 'both'
                varargout{1} = LinearVariables;
                varargout{2} = NonlinearVariables;
            otherwise
                error
        end
    otherwise
        error
end

⌨️ 快捷键说明

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