simplify.m

来自「optimization toolbox」· M 代码 · 共 19 行

M
19
字号
function Y=simplify(X)
%SIMPLIFY  Reduce PWA complexity

% Author Johan L鰂berg
% $Id: simplify.m,v 1.1 2006/08/10 18:00:22 joloef Exp $

variables = getvariables(X);
extstruct = yalmip('extstruct',variables(1));
if ~isempty(extstruct)
    if isequal(extstruct.fcn,'pwa_yalmip')
        extstruct.arg{1}{1}.Fi = extstruct.arg{1}{1}.Bi;
        extstruct.arg{1}{1}.Gi = extstruct.arg{1}{1}.Ci;
        simplified = mpt_simplify(extstruct.arg{1}{1});
        simplified.Bi = simplified.Fi;
        simplified.Ci = simplified.Gi;
        Y = pwf(simplified,extstruct.arg{2},extstruct.arg{3});
    end
end

⌨️ 快捷键说明

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