How to save continously generating mat file in a Array in Matlab?

2 ビュー (過去 30 日間)
Rubel Ahmed
Rubel Ahmed 2021 年 2 月 4 日
回答済み: Rubel Ahmed 2021 年 2 月 4 日
Hi all,
I am running a big Matlab programm for 1million iterations i.e. ttt=1000000. To save the output data after regular interval say every 10000 iterations I am putting a command as below and I save the data in mat file say data1.mat
if mod(ttt,10000)==0
save data1.mat
end
every after 10000 iterations the program generating a mat file name data1. This first matfile cointaining a lot of variables. To analysis the data further I need to save this data1.mat file. but the problem is when another 10000 iterstions are completing then another data1.mat file is generating which immediately replacing the previous data1 by the present data1. This is happining untill finish all the iterations. I want to save all the mat file which are generating after every 10000 iterations like below. Hope you guys can help me with this. Thanks in advance.
All_data =[data1,data1,data1......] i.e. All_data =[ data for first 10000(0-10000), data for next 10000 iterations(10001-20000),data for next 10000 iterations(20001-30000),............................].
  3 件のコメント
Rubel Ahmed
Rubel Ahmed 2021 年 2 月 4 日
編集済み: Rubel Ahmed 2021 年 2 月 4 日
Thanks @Walter Roberson. I can save data in matfile but I need to save all the generated matfile(after every 10000 iterations) in one Array/file to analysis furher.
Walter Roberson
Walter Roberson 2021 年 2 月 4 日
The point is that when you use matfile, the file is continually updated as you assign to the variables involved. Just store into one big array.

サインインしてコメントする。

回答 (1 件)

Rubel Ahmed
Rubel Ahmed 2021 年 2 月 4 日
@Walter Roberson Thanks, Can you please describe breifly ?

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by