Code covered by the BSD License  

Highlights from
Project Manager

5.0

5.0 | 1 rating Rate this file 13 Downloads (last 30 days) File Size: 94.1 KB File ID: #23218
image thumbnail

Project Manager

by

 

06 Mar 2009 (Updated )

Open/close m-files and change the current path with one click, across your different projects.

| Watch this File

File Information
Description

It is updated for R2011a and tested for Windows and Mac. For ease of use, I wrote an installer. (Installer is not provided for older Matlabs. Sorry... If your Matlab version is 2010b or earlier, please manually install the old version.)

Installation:

  >> pm('install')

After installation, you'll see a project manager menu added to the shortcuts category in the Matlab 'start' button as shown in the screenshot.

A shortcut for your current project is automatically added by installation.

When you make a new project, save it first, and then use the "Add a shortcut for the proj" to make a shortcut for it. (Note: you should save your project first BEFORE making a shortcut!)

Enjoy~!

===================================

Note 1.
The shortcut generated by "Add a shortcut for the proj" has a simple callback script:

pm('save_project')
pm('open_project', 'path to your project file.mat')

pm does not save your current project. But if you want that functionality, you can do it yourself very easily by modifying the shortcut like:

save workspace
clear
pm('save_project')
pm('open_project', 'you project file.mat')
load workspace

You can further optimize this shortcut as you want. As an example, if you want to use the name of the current project to save your workspace,

[~,name] = fileparts(pm('current_project'));
save([name,'_workspace.mat'])
clear
pm('save_project')
pm('open_project', 'you project file.mat')
[~,name] = fileparts(pm('current_project'));
load([name,'_workspace.mat'])

Or if you have your own local startup_local.m or finish_local.m, which are different across your projects, then

cd(fileparts(pm('current_project')));
finish_local;
pm('save_project')
pm('open_project', 'you project file.mat');
cd(fileparts(pm('current_project')));
startup_local;

There will be many ways of optimizing your shortcuts.

===================================

Note 2:

project manager resets your 'userpath' frequently. If you don't know about 'userpath', you don't have to worry. If you control your 'userpath' extensively, reconsider using this program. Otherwise, it is highly recommended to use the default Matlab 'userpath'. See 'help userpath' for more detail.

===================================

Note 3:

You can use automatic installation feature if you don't have any complex customized startup.m/finish.m in many scattered places. If you do have many startup.m/finish.m, renaming those is highly recommended (such as startup_local.m/finish_local.m) and centralize startup.m/finish.m in the Matlab default "userpath" folder. If you want to keep many startup.m/finish.m files in different folders, then please read manual installation section in the help to use Project Manager (it is very easy).

MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
08 Jan 2013 Sung Soo Kim

Thank you Thaddeus. That problem was found and resolved several months ago, but I forgot to update it here. The new files with a small number of improvements were uploaded. Thanks again.

07 Jan 2013 Thaddeus

When opening a project, the project pathdef should be applied before opening the project files, otherwise any doucments not in the current/default path will open up as blank documents (i.e. "untitled<#>" ).

Edited order of operations for open_project cell that begins on line 645 by swapping step 1 & 2, and all is good.

Using Matlab 2012a on OS X 10.8.2.

26 Sep 2011 Sung Soo Kim

The sample 'proj 1' shortcut contains the following script.

pm('save_project')
pm('open_project', 'you project file.mat')

pm does not save your current project. But if you want that functionality, you can do that very easily by modifying this shortcut like:

save workspace
clear
pm('save_project')
pm('open_project', 'you project file.mat')
load workspace

You can further optimize this shortcut as you want. For example, if you want to use the name of the current project for your workspace saving,

[~,name] = fileparts(pm('current_project'));
save([name,'_workspace.mat'])
clear
pm('save_project')
pm('open_project', 'you project file.mat')
[~,name] = fileparts(pm('current_project'));
load([name,'_workspace.mat'])

and so on.

23 Sep 2011 Sung Soo Kim

There is a minor bug. To install pm, you need to have at least one document opened (any document is OK including untitled one). Otherwise, pm installer will say your system is not compatible. But, it actually works very well in R2011a/b. This bug will be fixed and uploaded soon.

14 Jul 2011 Sung Soo Kim

Thanks for your comment.
I found the same problem just now in my new version of Matlab. It turned out that Mathworks changed some internal JAVA class methods manipulating the editor. I need to figure out what kinds of methods I can use. If I'm done, I'll update it.
Thanks again.

07 Jul 2011 David Holtschlag

The project management idea is a great concept. It would be very helpful if the Mathworks implemented this capability in its software. Until then, I thought I'd give 'pm' a try. I'm running Matlab v. 7.12 on Windows XP 64-bit computer. Running "pm" from the command line produced the following results. My computer is pretty well locked down, so it may be a permissions issue.

>> pm

=========================================================
Checking editor services...
Cannot use com.mathworks.mlservices.MLEditorServices.builtinGetOpenDocumentNames
Sorry. You cannot use pm.m
Cannot use com.mathworks.mlservices.MLEditorServices.isDocumentDirty
Sorry. You cannot use pm.m
Cannot use com.mathworks.mlservices.MLEditorServices.builtinGetActiveDocument
Sorry. You cannot use pm.m
=========================================================

Sorry. You cannot use pm.m

Updates
27 May 2009

Minor bug fix.

19 Jun 2009

copyright update

20 Sep 2011

now works in R2011a. unit_test is dropped. use the old version for matlab R2010b or earlier.

22 Sep 2011

installer added (shortcuts will be added to the Matlab "Start" button), bug fixes, loosely tested in both Mac OS X/Windows XP sp3

22 Sep 2011

installer bug fix.

25 Sep 2011

installer bug fix

29 Sep 2011

installer update, a button for making a shortcut of the current project, No need to restart after installation

01 Oct 2011

intro updated, no code mod,

08 Jan 2013

bug fixes and improvements : startup_sample.m, finish_sample.m scripts were improved. File opening problem was resolved.

Contact us