Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
Rubel Ahmed
Rubel Ahmed el 4 de Feb. de 2021
Respondida: Rubel Ahmed el 4 de Feb. de 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 comentarios
Rubel Ahmed
Rubel Ahmed el 4 de Feb. de 2021
Editada: Rubel Ahmed el 4 de Feb. de 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 el 4 de Feb. de 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.

Iniciar sesión para comentar.

Respuestas (1)

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

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by