problem with saving variables to .mat file- the variables of the old .mat files are changing after saving new ones
Mostrar comentarios más antiguos
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
Walter Roberson
el 25 de Nov. de 2015
How have you determined that the older files change content?
Gil Averbuch
el 26 de Nov. de 2015
Titus Edelhofer
el 26 de Nov. de 2015
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?
Walter Roberson
el 26 de Nov. de 2015
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)
Respuestas (1)
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
Gil Averbuch
el 26 de Nov. de 2015
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!