File Exchange

image thumbnail

whats

version 1.0.0.0 (2.71 KB) by Matt Fig
Duplicates the output of Matlab function WHAT, with clickable links.

3 Downloads

Updated 16 Jul 2008

View License

Editor's Note: This file was selected as the MATLAB Central Pick of the Week

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.

Cite As

Matt Fig (2021). whats (https://www.mathworks.com/matlabcentral/fileexchange/20615-whats), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

the cyclist

This is probably the utility function I use the most day-to-day. Great functionality. (I've been using it for years, but forgot to rate it.)

I modified it to include the new *.mlx file type (for the MATLAB Live Editor) -- only to discover that the built-in "what" command doesn't support them yet!

Matthew Arthington

Super little function.

Jacob

When my command window is very narrow, I get the error

??? Attempted to access nmprln(0); index
must be a positive integer or logical.

Error in ==> whats>formatter at 87
nmprln = nmprln(end); % For BC to ver 6.5:
no 'last' arg to find func. :(

This is solved by reversing lines 87 and 88 in the code. Otherwise, it's great.

John D'Errico

Nice utility. I like it.

mani kandan

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

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.

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

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

matt fig (author)

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

Thierry Dalon

Brings an error if what finds several directories.

matt fig (author)

Thanks Dan Mac.
Update will be submitted.

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.

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

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.

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.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: mfiles/matfiles/figfiles

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!