Skip to content

what

miscellaneous · scripts/miscellaneous/what.m

: what
: what folder
: s = what (folder)

List the code and data files of a folder.

Without argument the current folder is listed. folder is an existing folder, given by its absolute path or relative to the current folder, or the partial path of a folder below a folder of the search path. Without output the files are printed, grouped by kind.

With an output, s is a structure array with one element for each folder found, which has the fields

path

the absolute path of the folder,

m
mat
mex
nxo
mdl
slx
p

sorted column cell arrays with the names of the M-files, MAT-files, MEX-files, compiled object files, model files and P-files,

classes

class folder names without the leading ‘@’ (MATLAB R2026a),

packages

package folder names without the leading ‘+’ (MATLAB R2026a).

When no folder is found, s is an empty structure array of size 0-by-1 with the same fields.