findFile finds recursively all files in root.
findFile with all default options.find the location of findFile.m
FullPath=which('findFile');
%extract the directory containing findFile.m
root=fileparts(FullPath);
%list the content of the directory containing findFile.m
list = findFile(root);Make sure that the FSDA path is loaded (call routine addFSDA2path).
addFSDA2path
% Find the location of findFile.m
FullPath=which('addFSDA2path');
% extract the root directory of FSDA
FSDAroot=fileparts(FullPath);
%list the content of the directory under FSDA named 'graphics'
list = findFile(FSDAroot,'InclDir','graphics');
% find the location of findFile.m
% Make sure that the FSDA path is loaded (call routine addFSDA2path).
addFSDA2path
FullPath=which('addFSDA2path');
% extract the root directory of FSDA
root=fileparts(FullPath);
disp('Path of FSDA root is:')
disp(root)
disp('----')
list = findFile(root,'InclDir','graphics','ExclFiles','res*');html.
pathdocroot=docroot; pathExtHelpFile=findFile(pathdocroot,'InclFiles','gplotmatrix.html');
root — Root directory.
String.Case sensitive string that can indicate relative or absolute path. Use '.' for current directory.
Data Types: string
Specify optional comma-separated pairs of Name,Value arguments.
Name is the argument name and Value
is the corresponding value. Name must appear
inside single quotes (' ').
You can specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
'InclDir','dirname'
, 'ExclDir','dirname'
, 'InclFiles','filename'
, 'ExclFiles','filename'
InclDir
—Include directory pattern(s).string | cell arrays of strings.User can use wildcards. Do not use regular expression, for examples 'abc' and 'ab*de*'. File separator (i.e. '\' in Windows or '/' in Unix) is not allowed. Case-sensitive.
This filter is skipped if InclDir='', InclDir={}, InclDir='*' or if one of the element of the cell array InclDir is '*'. Default: InclDir={''}.
Example: 'InclDir','dirname'
Data Types: (cell array of) string
ExclDir
—Exclude directory pattern(s).string | cell arrays of strings.User can use wildcards. Do not use regular expression. Examples: 'abc' and 'ab*de*'. Use '' or {} to skip this stage. File separator (i.e. '\' in Windows or '/' in Unix) is not allowed. Case-sensitive. Default: ExclDir={''}.
Example: 'ExclDir','dirname'
Data Types: (cell array of) string
InclFiles
—Include file pattern(s).string | cell arrays of strings.User can use wildcards. Do not use regular expression.
Use '*' to include all files. Note that '*' and '*.*' give the same behaviour and return all files. File separator (i.e. '\' in Windows or '/' in Unix) is not allowed.
Case-sensitive. Default: InclFile={'*'}.
Example: 'InclFiles','filename'
Data Types: (cell array of) string
ExclFiles
—Exclude file pattern(s).string | cell arrays of strings.User can use wildcards. Do not use regular expression.
Use '' or {} to skip this check. File separator (i.e. '\' in Windows or '/' in Unix) is not allowed.
Case-sensitive. Default: ExclFiles={''}.
Example: 'ExclFiles','filename'
Data Types: (cell array of) string
list —All files.
Cell array of stringsList of all files matched under root directory, sorted in alphabetical and ascending order. Always return absolute path.