function varargout = and(varargin)%AND (overloaded)%% z = and(x,y)% z = x & y%% It is assumed that x and y are binary variables (either explicitely% declared using BINVAR, or constrained using BINARY.)%% See also SDPVAR/OR, SDPVAR/XOR, SDPVAR/NOT, BINVAR, BINARYswitch class(varargin{1})case 'char'z = varargin{2};xy = [];for i = 3:narginxy = [xy varargin{i}];endvarargout{1} = (xy >= z) + (length(xy)-1+z >= sum(xy)) + (binary(z));varargout{2} = struct('convexity','none','monotonicity','none','definiteness','none','model','integer');varargout{3} = xy;case {'sdpvar','double','logical'}varargout{1} = vectorizedlogic(@and,varargin{:});otherwiseend
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。