File Exchange

image thumbnail

MATLAB project manager

version 1.1 (2.97 KB) by

Missing command-line project manager for MATLAB.

5 Ratings

1 Download


View License

Manages current working directory and files that are opened in MATLAB editor (but not the workspace) for different projects.

Usage: PROJECTS(cmd, projectName)

PROJECTS('list') shows all stored projects. Arrow marks active project.

PROJECTS('active') returns the name of the active project

PROJECTS('show') shows information about the current project
PROJECTS('show', project_name) shows information about the project

PROJECTS('close') closes all opened files

PROJECTS('save') saves current working directory and editor state under the active project
PROJECTS('save', projectName) saves current working directory and editor state under the specified project name

PROJECTS('load') restores the project "default"
PROJECTS('load', projectName) restores the project with specified name

PROJECTS('open') is synonym for PROJECTS('load')

PROJECTS('rename', newName) renames the active project
PROJECTS('rename', projectName, newName) renames the project

PROJECTS('delete') deletes the active project
PROJECTS('delete', projectName) deletes the project with specified name

projects list
projects save myProject
projects close
projects load default
projects rename myProject myLibrary

All projects are stored in the %userpath%/projects.mat. This file with the empty "default" project is created at the first run of the script.
First project always has name "default".
MATLAB versions older than R2011a (7.12) are not supported.


Comments and Ratings (10)


Very useful contribution. Exactly what I was looking for.

I've implemented the changes suggested by Warwick (see below).

Fixed version here:

I'm planning to add a option to use dropbox or not (based on christhechris v2 - see below).


I find this a very useful contribution. I use chrishechris' version - see below. Now that I've upgraded to 2016B (for Mac, anyway) it needs a small change at Line 60 - thus -
fpath = fullfile(fpath(1:end-1), 'projects.mat');
fpath = fullfile(fpath, 'projects.mat');


Thanks for this very helpful.
I've had a couple modification that I thought I'd share...

To fix the Variable output array "varargout" error, change this:
if nargout==0
varargout = [];

To this:
if nargout==0
varargout = cell(0,0);

Fixed version here (

I also made some modifications that let me sync projects across multiple computer using Dropbox (including cross-platfrom).


Worked fine in 2015a, but returns "Variable output array "varargout" must be a cell array.

Error in projects (line 49)
function varargout = projects(cmd, varargin)"

in 2015B.


Bruce (view profile)

Very useful... Wondering about a couple of conceptual changes. I'm sure 99% of the folks who use this rename the default project to something that's more meaningful. When that project is "done", we'd like to be able to delete that project, but we can't because the code "thinks" that project #1 is default and therefor undeletable. How about changing the logic so that you can't delete the only project in the list? A quick look at the code says it's a bit more complicated than that, but it would make the package far more useful (at least in my opinion).


Bruce (view profile)


useful to me.


Vladimir (view profile)

Hi, per isakson. Thank you for the bug report.

I updated the script (it should appear here shortly, or the new version is on github) - now it will call "userpath('reset')" if the userpath is empty.

per isakson

My first try resultet in:

Subscript indices must either be real positive integers or logicals.
Error in projects (line 65)
projectsList(1).ActiveDir(end) = [];

The reason is that the function, userpath, returns empty on my system (R2012a).



Small bugfix: if userpath is empty - the script will reset it to the default value

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video