function y = stackcell(dummy,blocks) %STACKCELL Internal function for rapid concatenation % % [x1 x2 ... xn] is written as stackcell(sdpvar(1,1),{x1,x2,x3,...,xn}) % Why the first argument? A hack to make it a method for sdpvar... % Author Johan Löfberg % $Id: stackcell.m,v 1.5 2006/07/26 20:17:58 joloef Exp $ nblocks = size(blocks,2); % Get dimensions n = zeros(nblocks,1); m = zeros(nblocks,1); isasdpvar = zeros(nblocks,1); % Get dimensions for i = 1:nblocks [n(i),m(i)]=size(blocks{i}); isasdpvar(i) = isa(blocks{i},'sdpvar'); end if ~any(isasdpvar) y = blocks{1}; for i = 2:length(blocks) y = [y blocks{i}]; end return; end % Keep only non-empty keep_these = find((n.*m)~=0); if length(keep_these)