vertical concatenation of matrices in a loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yuvashree Mani Urmila
el 13 de Jun. de 2014
Editada: Mischa Kim
el 13 de Jun. de 2014
I have a set of matrices saved in a data structure. I need to vertically concatenate the matrices. The number of columns is consistent for every matrix. how is it possible to do this in the loop i have written here. thanks
for fileNr =1:8
outputFileName = outputFileNames(fileNr);
outputFileName = outputFileName{1};
outputFileName = strcat(outputFolder, filesep, outputFileName);
FileName=(outputFileName);
FileName
data1=load(FileName);
data=data1.dataStruct.data;
end
0 comentarios
Respuesta aceptada
Mischa Kim
el 13 de Jun. de 2014
Editada: Mischa Kim
el 13 de Jun. de 2014
Yuvashree, try
data = [];
for fileNr = 1:8
[...] % removed code for better readability
data1 = load(FileName);
if (rem(fileNr,8)==0) % save every 8th matrix
data = [data; data1.dataStruct.data];
end
end
2 comentarios
Yuvashree Mani Urmila
el 13 de Jun. de 2014
Editada: Yuvashree Mani Urmila
el 13 de Jun. de 2014
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations 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!