Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to convert all fig files in a folder to svg using plot2svg from msdos?
Replies: 11   Last Post: Oct 6, 2013 9:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
ANI

Posts: 6
Registered: 10/1/13
How to convert all fig files in a folder to svg using plot2svg from msdos?
Posted: Oct 1, 2013 6:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.