File Exchange

image thumbnail

MATLAB project manager

version 1.1 (2.97 KB) by

Missing command-line project manager for MATLAB.

4.66667
5 Ratings

3 Downloads

Updated

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

Examples:
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.

Git-repository: https://github.com/vfilimonov/matlab-projects

Comments and Ratings (10)

daniloz

Very useful contribution. Exactly what I was looking for.

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

Fixed version here: https://github.com/daniloz/matlab-projects/releases/tag/v1.2

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

Warwick

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 -
CHANGE
fpath = fullfile(fpath(1:end-1), 'projects.mat');
TO
fpath = fullfile(fpath, 'projects.mat');

christhechris

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 = [];
end

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

Fixed version here (https://github.com/christhechris/matlab-projects/releases/tag/v1.1).

I also made some modifications that let me sync projects across multiple computer using Dropbox (including cross-platfrom). https://github.com/christhechris/matlab-projects/releases/tag/v2.

Warwick

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

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

Bruce (view profile)

Warwick

useful to me.

Vladimir

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).

Updates

1.1

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