problem with saving variables to .mat file- the variables of the old .mat files are changing after saving new ones

Hello,
I have a function that does some calculations and saves the important variables to a .mat file with a specific name so the variables are the same but the name of the file is different. Every time that I save a new .mat file the variables on the older files changes their values to the new ones (their name is not changing).
This is how I save:
name=sprintf('Fisher_Hough_test_SNR_%f_window_size_%d_overlap_%d_percent.mat',SNR,bin_size,overlapping);
save(name,'noisy','F_fin','app_slow','wave_ang','snr','F_results','H_results','H_density','H_superdensity','Hscatter_s_d', '-v7.3');
Any suggestions?

4 comentarios

How have you determined that the older files change content?
Strange. The file should only change it's content if you touch it again (i.e., save to the same file)...? Can you verify (e.g. by time stamp of the file) that the file itself has not changed/was updated?
Please be more specific about how you are "looking at their values"
Please dir() one of the older files before the save() and store the result in a variable, and then dir() the same file again after the save to a different file, and store the result in a different variable, and then compare the two structures to see if there are differences (in particular differences in the timestamps)

Iniciar sesión para comentar.

Respuestas (1)

Thorsten
Thorsten el 26 de Nov. de 2015
Editada: Thorsten el 26 de Nov. de 2015
That's not possible. You have probably overwritten the old mat files. Please double check your code. If you still think that this happens, please provide a minimal example that reproduces this behavior such that we can have a look.

1 comentario

I found the problem. Matlab opened the latest figures that was saved every time instead of printing again the old ones.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 25 de Nov. de 2015

Comentada:

el 26 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by