I have many fig files with random names (say ps.fig, vdc.fig etc) in a folder. I want to convert all of them in to svg files (with names say ps.svg, vdc.svg etc) using plot2svg. And I want to do it from windows command window using a batch file.
@ECHO OFF ECHO We will convert matlab figure files to svg files now! CD /D %~dp0 SET Program="matlab.exe" %Program% -nodesktop -nosplash -r fig2svg.m
Since -r directive takes only one argument, I need to write a script file. The script should open each fig file one by one and operate plot2svg on each of them and save them with the respective names (ps.fig ? ps.fig and so on). I will be happy if no window opens. If not after successful completion, the window should close.
The problem: As I am not that well versed with matlab scripting, I ran out of ideas. All my attempts have already failed.
The question: How to do it? I will be grateful for any help. Please assume that I am a newbie.