save matrix in loop to 3D matrix (storage all inkomming matrix)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nik Rocky
el 3 de Jul. de 2020
Comentada: Nik Rocky
el 4 de Jul. de 2020
Hello,
I read multiple .mat-files with matrix M x-y-axis (5x2doubles) and have to save it. I think, the better way is to create a 3D-matrix - z-axis. Later, i have to make mean and std trow all z-axis elements. How can i do it?
Please think about - i get a matrix M in the loop, by load(MAT_File)
Thank you in advise!
0 comentarios
Respuesta aceptada
madhan ravi
el 3 de Jul. de 2020
M = cell(n, 1); % n - number of files
for k = 1:n
M{k} = load(filenames{k}); % assuming you saved filenames in a cell array
end
M = cat(3, M{:});
MEAN = mean(M, 3)
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Other Formats 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!