1 function y = combvec(varargin)
2 %COMBVEC Create all combinations of vectors.
10 % COMBVEC(A1,A2,...) takes any number of inputs,
11 % A1 - Matrix of N1 (column) vectors.
12 % A2 - Matrix of N2 (column) vectors.
13 % and returns a matrix of (N1*N2*...) column vectors, where the columns
14 % consist of all possibilities of A2 vectors, appended to
19 % a1 = [1 2 3; 4 5 6];
23 % Mark Beale, 12-15-93
24 % Copyright 1992-2005 The MathWorks, Inc.
25 % $Revision: 1.1.6.2 $ $Date: 2005/12/22 18:19:12 $
27 if length(varargin) == 0
31 for i=2:length(varargin)
33 y = [copy_blocked(y,size(z,2)); copy_interleaved(z,size(y,2))];
37 %=========================================================
38 function b = copy_blocked(m,n)
46 %=========================================================
48 function b = copy_interleaved(m,n)
56 b = reshape(b,mr,n*mc);
function end(in obj, in k, in n)
Overload of indexing end statement.