sos.m
来自「matlab波形优化算法经常要用到的matlab toolbox工具箱:yalm」· M 代码 · 共 40 行
M
40 行
function X=sos(X,r)
%SOS Declare sum-of-squares structure
%
% F = set(sos(p),r)
%
% Input
% p : SDPVAR object
% r : Desired rank (optional)
% Output
% F : SET object
%
% Example:
% Typical usage is
%
% F = set(sos(p))
%
% An experimental feature is to search for
% low rank decompositions. To search for a
% decomposition using at most 3 terms, use
% a second argument
%
% F = set(sos(p,3))
%
% Note that his feature requires the solver LMIRANK.
%
% See also SOSEX
% Author Johan L鰂berg
% $Id: sos.m,v 1.7 2007/03/13 09:02:22 joloef Exp $
%if ~issymmetric(X)% X.n>1 | X.m>1
% error('SOS can only be applied to symmetric polynomial matrices');
%end
if nargin<2
r = inf;
end
X.typeflag = 11;
X.extra.sosid = yalmip('sosid');
X.extra.rank = r;
X = set(X);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?