I have a two dimensional mat file. i want to extract each row into seperate mat files ?
1 次查看(过去 30 天)
显示 更早的评论
Wasna Madushanka Ediri Arachchi
2017-12-8
评论: Wasna Madushanka Ediri Arachchi
2017-12-9
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 个评论
KSSV
2017-12-8
It can be done...but why you want to do that? You have everything already in a single mat ile.
采纳的回答
KSSV
2017-12-8
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 个评论
更多回答(1 个)
Wasna Madushanka Ediri Arachchi
2017-12-8
编辑:Wasna Madushanka Ediri Arachchi
2017-12-8
4 个评论
Stephen23
2017-12-8
@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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!