How to update multi-level cell array in a Parfor loop
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 12 Août 2015
Did you create your own variable or function named length? Because length(scalar) is 1 for all constants. length(1920) is 1
Réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!