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

2 Ansichten (letzte 30 Tage)
Rubel Ahmed
Rubel Ahmed am 4 Feb. 2021
Beantwortet: Rubel Ahmed am 4 Feb. 2021
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 Kommentare
Rubel Ahmed
Rubel Ahmed am 4 Feb. 2021
Bearbeitet: Rubel Ahmed am 4 Feb. 2021
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 am 4 Feb. 2021
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rubel Ahmed
Rubel Ahmed am 4 Feb. 2021
@Walter Roberson Thanks, Can you please describe breifly ?

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by