How to update multi-level cell array in a Parfor loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 12 de Ag. de 2015
Did you create your own variable or function named length? Because length(scalar) is 1 for all constants. length(1920) is 1
Respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!