On define a large scale arrays

1 回表示 (過去 30 日間)
C Zeng
C Zeng 2013 年 1 月 6 日
Hi, all, I want to define and store a large scale arrays, like ones(3^N,1000,N) and N can be 15. However, matlab says it is out of memory, because of the large scale.
I wonder is there any way to resolve it? I mean, to fulfill the purpose but satisfy the requirement of matlab? Actually ones(3^N, 1000,1) is still very large scale.
Thanks.

採用された回答

Image Analyst
Image Analyst 2013 年 1 月 6 日
Does it need to be double? Can it be single, uint8, or logical instead? Will it have any values other than 1 or small integers?
  5 件のコメント
Image Analyst
Image Analyst 2013 年 1 月 6 日
Are you sure that you need to whole matrix in memory at one time? Can't you work in "chunks"? Like work on a smaller cube of it at a time? Will you eventually access each and every one of those elements? Or can you use "sparse" matrices? Have you read the Mathworks guidance on this issue: Memory Usage
C Zeng
C Zeng 2013 年 1 月 6 日
I may not need all matrix at a time and yes I can work in chunks. Let me double check the problem. Thank you for your suggestion!

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2013 年 1 月 6 日
編集済み: Matt J 2013 年 1 月 6 日
Are the entries mostly zeros? Could you use the SPARSE command?
If you need to work with n-dimensional sparse arrays, there is this:
  3 件のコメント
Matt J
Matt J 2013 年 1 月 6 日
If they are mostly ones, you can express the array as
1 + sparse_array
and rewrite your computations in terms of that.
C Zeng
C Zeng 2013 年 1 月 6 日
Yes, could be helpful, let me find it out. Thanks.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by