optimization toolbox

源代码在线查看: plus.m

软件大小: 935 K
上传用户: jhjfjh22544
关键词: optimization toolbox
下载地址: 免注册下载 普通下载 VIP

相关代码

				function Z = plus(X,Y)
				% PLUS (overloaded)
				
				% Author Johan L鰂berg
				% $Id: plus.m,v 1.2 2006/07/13 19:40:59 joloef Exp $
				
				dim = [];
				if isa(X,'ndsdpvar')
				    dim = X.dim;
				    X = sdpvar(X);
				elseif isa(X,'double')
				    X = X(:);
				end
				
				if isa(Y,'ndsdpvar')
				    if isempty(dim)
				        dim = Y.dim;
				    else
				        if isequal(dim,Y.dim)
				        else
				            error('Dimension mismatch in nD addition')
				        end
				    end
				    Y = sdpvar(Y);
				elseif isa(Y,'double')
				    Y = Y(:);
				end
				
				Z = X + Y;
				Z = reshape(Z,dim);			

相关资源