This does not work well when there are many rows with the same column sum. I have a matrix of size ~45000 x 350 where the rows can have a sum of 1, 2 or 3; in this case the supplied function used about 100 times as long as the built-in matlab function. Also, if the same data is transposed the function does not work at all.

Other than that it seems to work very well for uniformly distributed data.

11 Mar 2010

findsubmat
Finds one matrix (a sub-matrix) within another.
Author: Matt Fig

Note the updated links for CLP and QSOPT solvers:
1. CLP by the COIN-OR project.
MEX interface can be found at:
http://control.ee.ethz.ch/~johanl/clp.php
3. QSOPT by David Applegate, William Cook, Sanjeeb Dash, and Monika Mevenkamp
MEX interface can be found at:
http://control.ee.ethz.ch/~johanl/mexqsopt.msql

Note the updated links for CLP and QSOPT solvers:
1. CLP by the COIN-OR project.
MEX interface can be found at:
http://control.ee.ethz.ch/~johanl/clp.php
3. QSOPT by David Applegate, William Cook, Sanjeeb Dash, and Monika Mevenkamp
MEX interface can be found at:
http://control.ee.ethz.ch/~johanl/mexqsopt.msql

I like to use this file for the folowing mathematical model but I have never used Matlab before. Can some one help please?
Minimize Somme of X(ik(i)) for i=1 to k
subject to:
X(ik)- T(ijk) >= X(ih)
X(pk)- X(ik)+ H *[1-Y(ipk)] >= T(pqk)
X(ik)- X(pk)+ H *[Y(ipk)] >= T(ijk)
X(ik)>=0
Y(ipk)= 0 or 1

Comment only