フィルターのクリア

How to add a large number of cell.

1 回表示 (過去 30 日間)
Abhishek mani  Shukla
Abhishek mani Shukla 2018 年 8 月 27 日
コメント済み: Amir Xz 2018 年 8 月 27 日
i have 3000 cell and each cell have size of 4*10^5.I want to add all cell in a single array of order (1,12*10^8).

採用された回答

Amir Xz
Amir Xz 2018 年 8 月 27 日
MatA = cell2mat(A);
ArrayA = reshape(MatA',1,12*10^8);

その他の回答 (1 件)

KSSV
KSSV 2018 年 8 月 27 日
Read about cell2mat and _sum)
A{1} = rand(2,1) ;
A{2} = rand(2,1) ;
A{3} = rand(2,1) ;
B = cell2mat(A) ;
sum(B)
You can achieve the above in many ways. Like using loop or cellfun.
  2 件のコメント
Abhishek mani  Shukla
Abhishek mani Shukla 2018 年 8 月 27 日
When i am using loop then it shows out of memory while i have 12 gb RAM.Thank for your suggestion.I will try your solution if it will working then good.
Amir Xz
Amir Xz 2018 年 8 月 27 日
If you use default class (double), so you need 8.94 GB memory!
64*(12*10^8)/(8*2^30) = 8.9407 GB
So, change the class if that's OK.
Use the same name for your variables and ...

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by