activecstr.m

来自「matlab7 gads工具箱」· M 代码 · 共 15 行

M
15
字号
function active = activecstr(x,A,LB,UB,ToL)
%ACTIVECSTR determines the active consraints with
% 	respect to A, LB and UB with a a specified tolerance 'tol'

%   Copyright 2004 The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 2004/01/16 16:51:04 $


%setup the costraint status A*x; we already have LB and UB.
Ax = A*x;
%Check the tolerance with respect to each constraints;
lowerbounds = (abs(LB-Ax)<=ToL);
upperbounds = (abs(Ax-UB)<=ToL);

active = any(lowerbounds) || any(upperbounds);

⌨️ 快捷键说明

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