Using combvec for full matrix (matlab)
<p>I have nxm matrix. I want to use combvec to produce all the possible combinations like this</p>

<pre><code>combvec(X(1,:),...,X(m,:))
</code></pre>

<p>If my matrix is different for each loop. How can I use the combvec syntax? Do I have to separate it by column? But How? </p>

<p>Example:
my matrix</p>

<pre><code>L=[25000000 15000000 10000000 5000000 3000000 2000000 1000000 800000 700000 500000 500000 300000 200000 100000 0]
L(2,:)=zeros(1,length(L))
</code></pre>

<p>How to avoid inputting one by one like this?</p>

<pre><code>    combination=combvec([25000000,0],[15000000,0],[10000000,0],[5000000,0],[3000000,0],[2000000,0],[1000000,0],[800000,0],[700000,0],[500000,0],[500000,0],[300000,0],[200000,0],[100000,0],[0,0])';
</code></pre>