How to save a figure file into a subfolder
Mostrar comentarios más antiguos
Hi guys,
I want to save my .fig files in a subfolder of the current working folder. how would I accomplish this using this saveas syntax
*************************************************
saveas(figure(i), fullfile('Figure name'), 'fig');
*************************************************
Many Thanks in advance
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 17 de Ag. de 2012
Editada: Image Analyst
el 17 de Ag. de 2012
Why not save them as images so that you can see them in any program or in WIndows Explorer? See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions.
But in general you'd need to specify the folder:
folder = 'c:\whatever';
baseFileName = sprintf('Figure %d', loopIndex);
fullFileName = fullfile(folder, baseFileName);
It's recommended that you don't use i as a loop index or variable name because that's the imaginary variable sqrt(-1).
2 comentarios
Pooja Mehta
el 23 de Feb. de 2017
I want to use this method for Gui and for that i need to add a select folder option in UI. Is there any function for selecting folder?
tchaddad
el 9 de Nov. de 2020
There is this:
Categorías
Más información sobre Printing and Saving 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!