- How large is your "huge matrix"?
- Is your matrix stored as a full matrix or a sparse matrix?
- Is it sparsely populated [few nonzero elements]? This is related to but distinct from the previous question; people sometimes store sparsely populated matrices in full storage or fully nonzero matrices in sparse storage.
- What data type is it?
- Do you have access to Parallel Computing Toolbox? If so, do you also have access to MATLAB Distributed Computing Server?
- Are you using this matrix multiplication to try to solve a system of equations A*x = b by multiplying by the inverse of A? If so, have you tried using the backslash operator and/or an iterative solver like GMRES?
- What operating system and release of MATLAB are you using? Are they 32-bit or 64-bit?
How to reduce memory for matrix multiplication?
8 ビュー (過去 30 日間)
古いコメントを表示
I guess this is more of a mathematical issue than particually Matlab. I have a matlab app including a huge matrix multiplication that takes up very much memory, which in some cases makes it impossible to run on a common PC. Is there a way to cut the multiplication into smaller pieces in order to reduce required memory.
1 件のコメント
Steven Lord
2016 年 3 月 23 日
編集済み: Steven Lord
2016 年 3 月 23 日
If you describe in more detail the problem you're trying to solve you may receive suggestions on alternate approaches you can use to solve it.
回答 (3 件)
John D'Errico
2016 年 3 月 23 日
編集済み: John D'Errico
2016 年 3 月 23 日
How can we answer this question? No, you cannot magically use less memory than you need for a computation. You make the decisions about what it is you want to do, what computations will be done. If they take too much memory, then you may just need to solve smaller problems, or you need to get more memory, or a bigger, faster computer.
One alternative is often that in fact, you really don't need to do that memory intensive computation, that you should in fact be doing it in some other way. But again, how can we answer that question? I cannot read your mind to know what it is that you are doing, and that possibly, you have created some hugely inefficient computation for no good reason. (Don't tell me this could not possibly happen. I've seen it done over and over again, sometimes by people who would have assured me they knew what they were doing.)
If we could make big computations into small ones, just by wanting it to be so, we would live in a very different world, and Harry Potter would be our friend.
3 件のコメント
Walter Roberson
2016 年 3 月 23 日
There are techniques for doing large memory multiplications with relatively small memory. The techniques may involve swapping to tape or disk.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!