I have a two dimensional mat file. i want to extract each row into seperate mat files ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Wasna Madushanka Ediri Arachchi
el 8 de Dic. de 2017
Comentada: Wasna Madushanka Ediri Arachchi
el 9 de Dic. de 2017
I have a two dimensional mat file. i want to extract each row into seperate mat files and name it accordingly. Can you pls make available a code?
1 comentario
KSSV
el 8 de Dic. de 2017
It can be done...but why you want to do that? You have everything already in a single mat ile.
Respuesta aceptada
KSSV
el 8 de Dic. de 2017
A = rand(10) ;
n = size(A,1) ;
for i = 1:n
filename = strcat('row',num2str(i),'.mat') ;
Ar = A(i,:) ;
save(filename,'Ar') ;
end
0 comentarios
Más respuestas (1)
Wasna Madushanka Ediri Arachchi
el 8 de Dic. de 2017
Editada: Wasna Madushanka Ediri Arachchi
el 8 de Dic. de 2017
4 comentarios
Stephen23
el 8 de Dic. de 2017
@Wasna Madushanka Ediri Arachchi: sure, your question makes it clear that you want to combine data. I asked why you are splitting one .mat file into lots of separate .mat files, and then apparently loading these back into memory to perform some operations on. Unless you are reaching the limits of your memory there seems to be no point to this diversion.
Ver también
Categorías
Más información sobre Structures 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!