mpt_remove_equalities.m

来自「求解线性矩阵不等式简单方便--与LMI工具箱相比」· M 代码 · 共 18 行

M
18
字号
function  Matrices = mpt_remove_equalities(Matrices,remove);
m  = size(Matrices.G,1);
nu = Matrices.nu;
nx = Matrices.nx;

Matrices.G(remove,:) = [];
Matrices.E(remove,:) = [];
Matrices.W(remove,:) = [];

% But add variable bounds (these where used to remove the rows)
Matrices.G = [Matrices.G;eye(nu);-eye(nu);zeros(2*nx,nu)];
Matrices.E = [Matrices.E;zeros(2*nu,nx);-eye(nx);eye(nx)];
Matrices.W = [Matrices.W;Matrices.ub(1:nu);-Matrices.lb(1:nu);Matrices.ub(nu+1:end);-Matrices.lb(nu+1:end)];
infbounds = find(isinf(Matrices.W) & (Matrices.W>0));
Matrices.G(infbounds,:) = [];
Matrices.E(infbounds,:) = [];
Matrices.W(infbounds,:) = [];

⌨️ 快捷键说明

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