iddober
iddober

Reputation: 1264

What Source Control Has MATLAB Integration?

I am using MATLAB R2008a and I want to know what source control has integration with it. I've heard Visual Source Safe is not so good. Does Subversion have integration with it?

Upvotes: 13

Views: 10288

Answers (7)

Andrew Janke
Andrew Janke

Reputation: 23898

I wouldn't worry about the Matlab source control integration. It's convenient, but not necessary.

Every modern source control system has one or more GUIs built for it, which will usually be more powerful than the generic source control GUI that Matlab provides. And most have command line utilities which expose the full power of the system. You can use these by getting them on your system path and then calling them from Matlab with "!". Or you can write your own M-code wrapper functions that call your source control utilities. As a convenience, these can support partial paths by using "which", like so.

function checkin(infile, comments)
file = which(infile);
if ~exist(file, 'file')
    error('Not a file: %s (resolved to %s)', infile, file);
end
cmd = sprintf('cvs commit -m "%s" %s', comments, file);

For external tools, if they make changes to files or dirs and Matlab doesn't see them (e.g. if you're on a network drive that's exhausted its change notification handles), you can use path(path) to force Matlab to rescan.

So, pick your source control system on its own merits (as long as it exposes its functionality in the command line or ActiveX controls), and then wrap it if you feel the need and Matlab doesn't already integrate it. I've worked with CVS, ClearCase, and AccuRev this way, and we've always ended up using the version control tools directly or through custom wrappers instead of the Matlab integration.

Upvotes: 15

Manu R
Manu R

Reputation: 836

To add to Andrew's point, here's a full-featured wrapper to use Git from the MATLAB command prompt: http://raghavan.info/blog/2010/10/30/make-matlab-git-play-well-together/

Upvotes: 1

AndyL
AndyL

Reputation: 14683

I find it most useful to stamp autogenerated graphs or figures with versioning information. For that I use git and this script, which provides Matlab with the current git repository branch, version hash, and information about its corresponding remote repository:

https://gist.github.com/1211669

Upvotes: 2

Edric
Edric

Reputation: 25160

On Windows (guessing from your mention of VSS), MATLAB integrates with the Microsoft source control API

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f7-5297.html

(I realise that's a R2009b doc link, but I believe the functionality was similar in R2008a).

So, you need to find an interface between the Microsoft API and your chosen source control system. For example

http://svnscc.tigris.org/

Upvotes: 1

Ian Hopkinson
Ian Hopkinson

Reputation: 3432

I use TortoiseSVN / Subversion with Matlab - there's no integration into the Matlab IDE (not even the overlay icons) but nevertheless it's pretty straightforward to use.

Upvotes: 2

duffymo
duffymo

Reputation: 308958

Or Git - also open source.

You're correct about VSS - not so good.

Upvotes: 3

erik
erik

Reputation: 3880

How about using Subversion? Its pretty good and free and open source!

Upvotes: 1

Related Questions