From: Steven on 4 Jun 2010 18:11 Hi, I am having to save lots of figure files and wanted to do it inside my m-file. I was using the saveas function, but that only seems to save in your current directory. Is there any way to save figures in a specified directory? Thanks, Steven
From: us on 4 Jun 2010 18:28 "Steven " <shimizust(a)gmail.com> wrote in message <hubtlp$96l$1(a)fred.mathworks.com>... > Hi, > > I am having to save lots of figure files and wanted to do it inside my m-file. I was using the saveas function, but that only seems to save in your current directory. Is there any way to save figures in a specified directory? Thanks, > > Steven one of the solutions - you simply add a partial or full path... fpat='folder_1'; fnam='foo.fig'; plot(1:10); saveas(gcf,[fpat,filesep,fnam],'fig'); us
From: ImageAnalyst on 5 Jun 2010 00:57 Or you can call the fullfile() function, or just change the folder with cd beforehand and not mess with the folder at all. I always prefer to make my filenames real explicit with sprintf() and fullfile() and not count on the current working directory being something in particular.
From: Steven on 5 Jun 2010 10:24 Thanks for the help, us and ImageAnalyst. It works great!
|
Pages: 1 Prev: Discrete u(k) or 1(k) Next: Sample time - sequence stair |