国外专家做的求解LMI鲁棒控制的工具箱,可以相对高效的解决LMI问题
源代码在线查看: diff.m
function Y=diff(varargin)
%DIFF (overloaded)
% Author Johan L鰂berg
% $Id: diff.m,v 1.2 2004/07/01 11:17:09 johanl Exp $
X = varargin{1};
n = X.n;
m = X.m;
Y = X;
x_lmi_variables = X.lmi_variables;
lmi_variables = [];
try
j = 1;
diffX = diff(reshape(X.basis(:,1),n,m),varargin{2:end});
Y.basis=diffX(:);
for i = 1:length(x_lmi_variables)
diffX = diff(reshape(X.basis(:,i+1),n,m),varargin{2:end});
if (norm(diffX,inf)>0)
Y.basis(:,j+1) = diffX(:);
lmi_variables = [lmi_variables x_lmi_variables(i)];
j = j+1;
end
end
if j~=1
Y.lmi_variables = lmi_variables;
else
Y = full(reshape(Y.basis(:,1),size(diffX,1),size(diffX,2)));
return
end
catch
error(lasterr)
end
Y.n = size(diffX,1);
Y.m = size(diffX,2);