summations of combinations of elements, one from each column of a 2D matrix, in small to large order
I have a 2D numerical matrix of size 1000 by 8: [0 a1 a2 a3 a4 … a999; 0 b1 b2 b3 b4 … b999; … ; 0 h1 h2 h3 h4 … h999]’ , where each column is in ascending order, i.e., 0<a1<a2<a3<…<a999, etc. However, I don’t know how a1 compares to b1, or c1, etc. For example, b100 could be smaller than a1.
Now, I would like to find the first 1000,000 combinations of 8 elements, each coming from a column, that have the smallest summation values. For each combination, I would like to retain the row and column indices of each element as well.
Can anyone help me with the problem? Thank you very much for your help in advance.I have a 2D numerical matrix of size 1000 by 8: [0 a1 a2 a3 a4 … a999; 0 b1 b2 b3 b4 … b999; … ; 0 h1 h2 h3 h4 … h999]’ , where each column is in ascending order, i.e., 0<a1<a2<a3<…<a999, etc. However, I don’t know how a1 compares to b1, or c1, etc. For example, b100 could be smaller than a1.
Now, I would like to find the first 1000,000 combinations of 8 elements, each coming from a column, that have the smallest summation values. For each combination, I would like to retain the row and column indices of each element as well.
Can anyone help me with the problem? Thank you very much for your help in advance. I have a 2D numerical matrix of size 1000 by 8: [0 a1 a2 a3 a4 … a999; 0 b1 b2 b3 b4 … b999; … ; 0 h1 h2 h3 h4 … h999]’ , where each column is in ascending order, i.e., 0<a1<a2<a3<…<a999, etc. However, I don’t know how a1 compares to b1, or c1, etc. For example, b100 could be smaller than a1.
Now, I would like to find the first 1000,000 combinations of 8 elements, each coming from a column, that have the smallest summation values. For each combination, I would like to retain the row and column indices of each element as well.
Can anyone help me with the problem? Thank you very much for your help in advance. combinations, summation, order MATLAB Answers — New Questions