overlap the same data 5 times
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I want to overlap the same mat file data five times. For example: I have 5 separate mat file data with same matrix value. Each mat file having its matrix of 11111x23.
Now i want to overlap all the data into one mat file.
I want my output like this at end,
Inputs: 11111x23
11111x23
11111x23
11111x23
11111x23
Output: 55555x23
Can someone please help me to solve my problem.
Thank you
0 comentarios
Respuestas (1)
KSSV
el 15 de Ag. de 2022
Let M be the matrix in your mat file.
matFiles = dir('*.mat') ;
N = length(matFiles) ;
iwant = [];
for i = 1:N
S = matfile(matFiles(i).name) ;
iwant = [iwant ; S.M] ;
end
2 comentarios
KSSV
el 16 de Ag. de 2022
That is not a comment. matFiles is a structure, this has a filed called name, which has the mat file name.
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files 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!