matlab波形优化算法经常要用到的matlab toolbox工具箱:yalmip

源代码在线查看: mldivide.m

软件大小: 849 K
上传用户: huanghuanl
关键词: matlab toolbox yalmip 波形优化
下载地址: 免注册下载 普通下载 VIP

相关代码

				function y = mldivide(X,Y)
				%MLDIVIDE (overloaded)
				
				% Author Johan L鰂berg 
				% $Id: mldivide.m,v 1.4 2006/07/26 20:17:58 joloef Exp $   
				
				if (isa(X,'sdpvar'))
				  error('Division of matrix variables not possible.')
				end
				
				try
				  lmi_variables = getvariables(Y);
				  nv = length(lmi_variables);
				  y  = Y;
				  n = Y.dim(1);
				  m = Y.dim(2);
				  if m==1     
				    y.basis = X\Y.basis;   
				    y.dim(1) = size(y.basis,1);
				    y.dim(2) = 1;
				  else % FIX : VECTORIZE THIS...
				    [L,U] = qr(X);
				    temp = U\(L\reshape(Y.basis(:,1),n,m));
				    y.basis = temp(:);
				    for i = 1:nv
				        temp = U\(L\reshape(Y.basis(:,i+1),n,m));
				        y.basis(:,i+1) = temp(:);
				    end;
				    y.dim(1) = size(temp,1);
				    y.dim(2) = size(temp,2);
				  end
				catch
				  error(lasterr);
				end			

相关资源