- Thread starter
- #1

#### OhMyMarkov

##### Member

- Mar 5, 2012

- 83

I'm trying to solve a linear optimization problem with a large-dimension matrix, MATLAB says memory is full. What to do?

Thanks!

- Thread starter OhMyMarkov
- Start date

- Thread starter
- #1

- Mar 5, 2012

- 83

I'm trying to solve a linear optimization problem with a large-dimension matrix, MATLAB says memory is full. What to do?

Thanks!

- Jan 26, 2012

- 890

See if you can use sparse matrix functions?

I'm trying to solve a linear optimization problem with a large-dimension matrix, MATLAB says memory is full. What to do?

Thanks!

Check that you are not creating unnecessary copies of matrices and or temporary arrays?

How large is the large-dimension matrix?

CB

- Thread starter
- #3

- Mar 5, 2012

- 83

x = fmincon("at"ftest, zeros(24583,1), -eye(24583), zeros(24583,1), PHI, S,1,1);

Now, ftest is the L1 norm, PHI is the product of two matrices, a sampling 300x403 random matrix and a 403x24583 Gabor basis dictionary. Please note that one of the sampling matrix is in "full" representation while the larger matrix is in "sparse" representation. I also tried making PHI explicitly in sparse format to check but this didn't solve the problem?

It seems that the minimizer expands PHI.

Thank you for your time.

OMM

- Jan 26, 2012

- 890

That would not in itself be a problem (it is an ~79 MB structure), it is the fact that the system will generate multiple copies of arrays of that size in doing its work.

x = fmincon("at"ftest, zeros(24583,1), -eye(24583), zeros(24583,1), PHI, S,1,1);

Now, ftest is the L1 norm, PHI is the product of two matrices, a sampling 300x403 random matrix and a 403x24583 Gabor basis dictionary. Please note that one of the sampling matrix is in "full" representation while the larger matrix is in "sparse" representation. I also tried making PHI explicitly in sparse format to check but this didn't solve the problem?

It seems that the minimizer expands PHI.

Thank you for your time.

OMM

I presume the dimensions of S are not too great ...

CB