Dynamic-Calibration/utils/YALMIP-master/extras/@lmi/size.m

17 lines
444 B
Mathematica
Raw Normal View History

2019-12-18 11:25:45 +00:00
function varargout=size(varargin)
%size Returns the number of constraints
%
% n = SIZE(F) Returns the number of constraints
% [n,m] = SIZE(F) Returns the number of constraints, m=1
F = flatten(varargin{1});
switch (nargout)
case {0,1}
varargout{1} = [length(F.clauses) 1];
case 2
varargout{1} = length(F.clauses);
varargout{2} = 1;
otherwise
error('>2 outputs in size?');
end