Code covered by the BSD License  

Highlights from
Explore

3.0

3.0 | 3 ratings Rate this file 1 Download (last 30 days) File Size: 2.4 KB File ID: #23794

Explore

by Jesse Hopkins

 

15 Apr 2009 (Updated 06 Nov 2009)

Convenient way to open windows explorer.

| Watch this File

File Information
Description

% USAGE:
% explore
% opens explorer window to current file open in matlab editor. (if
% no file is open, then the current explorer window at current directory
% will be explored
%
% explore(file)
% opens explorer window to directory containing "file". This input
% can be a full-file-path, m-function name, or model name.
%
% explore(dir)
% opens explorer window to specified direcotry "dir". This input can
% be a full-path, relative-path, or just the name of any directory
% on the matlab path. Will open the first folder on the matlab-path
% matching the specified name.
%
%
% NOTE: You may change the executable called by explore.m. The default is
% "explorer". To change, use
% explore SetExplorerCommand <command>
%
% For example, to use UltraExplorer:
% explore SetExplorerComand 'UltraExplorer /p'
%
% Note that the path containing UltraExplorer.exe must be included
% in your Windows path environment variable.
%
% This setting is stored as a persistent variable, and will not be
% remembered between Matlab sessions, so this line should reside in
% your startup.m file to permanently change your explorer preference.
%

MATLAB release MATLAB 7.5 (R2007b)
Other requirements Windows Only
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
15 Apr 2009 Stead Kiger

See also "Explorer Toolbar Shortcut"

http://www.mathworks.com/matlabcentral/fileexchange/14140

16 Apr 2009 Steen Johansen

Does not seem to work in 2007R:

>> explore
??? No appropriate method or public field builtinGetActiveDocument for class com.mathworks.mlservices.MLEditorServices.

Error in ==> explore at 45
string = char(com.mathworks.mlservices.MLEditorServices.builtinGetActiveDocument);

16 Apr 2009 Eric

Or just use the built in explorer command in DOS along with the ! functionality. Try from the command line:

!explorer (Will open explorer window at top level of windows directory)

!explorer . (Will open explorer window in PWD)

!explorer c:/temp (Will open explorer window at specific address)

28 Apr 2009 Jesse Hopkins

Eric, the point of this script is so that you don't have to type a full path-name to the explorer command. For example, say you have a m-file called my_func.m in some location on your matlab path. If you want to open an explorer window, you can simply type 'explore my_func'. Otherwise you would have to type !explorer c:\path\to\my_func.

08 Feb 2010 Matthew Arthington  
08 Feb 2010 Matthew Arthington

Good script. I've got a less functional script that opens the current editor file's directory using

eval(['!explorer /e,' fileparts(com.mathworks.mlservices.MLEditorServices.builtinGetActiveDocument.toCharArray')]);

Please login to add a comment or rating.
Updates
15 Apr 2009

updated description

06 Nov 2009

Fixed handling of double quotes. Now also allows for configurable executable to run (defaults to "explorer.exe"), useful if you are running a replacement for windows explorer.

Tag Activity for this File
Tag Applied By Date/Time
windows explorer Jesse Hopkins 15 Apr 2009 13:51:28

Contact us at files@mathworks.com