How to update multi-level cell array in a Parfor loop

2 ビュー (過去 30 日間)
Xinwei
Xinwei 2015 年 8 月 12 日
コメント済み: Walter Roberson 2015 年 8 月 12 日
A=cell(length(10),length(1920));
parfor i=1:length(10)
temp=cell(1,length(1920));
for j=1:length(1920)
temp{j}=data{i}(data{i}(:,1)==dateIndex(j),2);
end
A{i,:}=temp;
end
I have this code in my program. I have A which is a 10 by 1920 cell array. and the loop inside will generate a variable 'temp' which will be 1 by 1920 multi-level cell array. looks like this
I want use make the A to be a 10 by 1920 first, and then aggregate all values (keep all values) in those 10 rows into one row, to be a 1by1920 cell array.
but i only managed to do A as follow:
Is there any suggestions and How can i aggregate 10 row multi-level cell into one row.
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 8 月 12 日
Did you create your own variable or function named length? Because length(scalar) is 1 for all constants. length(1920) is 1

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by