5.0

5.0 | 3 ratings Rate this file 130 downloads (last 30 days) File Size: 2.71 KB File ID: #20615

whats

by Matt Fig

 

08 Jul 2008 (Updated 16 Jul 2008)

Code covered by BSD License  

Duplicates the output of Matlab function WHAT, with clickable links.

Editor's Notes:

This file was selected as the MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

When called without an argument from the command line, WHATS lists the M-Files, MAT-Files and FIG-Files in the current directory as click-able links. Clicking on an M-File name opens the M-File for editing. Clicking on a MAT-File name loads the data stored in the MAT-File. Clicking on a FIG-File opens the figure. A different directory path (other than the current directory) can also be passed to WHATS as an argument, causing WHATS to list the files in that directory, and allowing the user to open or load the respective files. See the screen-shot for an example that shows the difference between WHAT and WHATS. I put this in my path so I can call it from anywhere.

Tested on 6.5, 2006a, 2007a

Please email me about bugs or other concerns. Thanks.

Acknowledgements
This submission has inspired the following:
mfiles/matfiles/figfiles
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (11)
09 Jul 2008 matt fig (author)

I was asked to add figure files to the listing.
Clicking on the names would open the figure.
I will update WHATS to do so.

10 Jul 2008 matt fig (author)

For some odd reason, neither the pic nor the file updated when I added the FIG-Files to the list. Only my description changed! I will try again.

12 Jul 2008 Urs (us) Schwarz

very(!) useful snippet meticulously following all help/coding standards; should replace ML's stock function WHAT...
in addition, programmers can easily extend its functionality by adding other file types...
us

14 Jul 2008 Dan Mac

I like it. There is one suggestion (really simple change) that I would suggest and that is in line 97. I would suggest that "'\'" be changed to "filesep" for compatability with other OSes.

15 Jul 2008 matt fig (author)

Thanks Dan Mac.
Update will be submitted.

16 Jul 2008 Thierry Dalon

Brings an error if what finds several directories.

16 Jul 2008 matt fig (author)

A new version has been submitted which addresses the request of Dan Mac and the bugs report of Thierry.

31 Jul 2008 Thierry Dalon

I would propose as solution when what finds several directories not to display only the first (like in current implementation) but to display all the directories found and let the user pick up the one he wants.

I've changed whats like this:
 W = what(path); % Use WHAT to get the files we want.
    nb_what=length(W); % TD
    if nb_what>1
        disp(sprintf('%s directories were found: (click to display whats)',num2str(nb_what)));
        for i=1:nb_what
            disp(sprintf('<a href="matlab:whats(''%s'')">%s</a>', W(i).path, W(i).path));
        end
        return
    end

28 Oct 2008 Mike Koelemay

I was able to make a couple easy small modifications such that it also lists MDL files, but only if the user has Simulink installed. I was going to email the file to you to check out but with this new layout on the Matlab file exchange I can't seem to figure out how to email you.

31 Oct 2008 Matt Fig

Hey Mike, my email address should be listed at the bottom of the help for all of my files on the FEX. Thanks.

12 Nov 2008 mani kandan

I want to contact u regarding ur project "txthide" Wtas ur mail id. I couldnot find it anywhere as u hav stated...

Please login to add a comment or rating.
Updates
10 Jul 2008

Added FIG-Files to list.

11 Jul 2008

For some reason the last update didn't replace the old file!

16 Jul 2008

Address reviewers requests/bug reports.

Tag Activity for this File
Tag Applied By Date/Time
path Matt Fig 22 Oct 2008 10:09:26
directories Matt Fig 22 Oct 2008 10:09:26
files Matt Fig 22 Oct 2008 10:09:26
html Matt Fig 22 Oct 2008 10:09:26
href dir Matt Fig 22 Oct 2008 10:09:26
load Matt Fig 22 Oct 2008 10:09:26
list Matt Fig 22 Oct 2008 10:09:26
edit Matt Fig 22 Oct 2008 10:09:26
directory files Matt Fig 22 Oct 2008 10:09:26
potw Cristina McIntire 07 Nov 2008 13:06:35
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com