Recursive Directory Function Execution

版本 1.0.0.0 (1.6 KB) 作者: Rodney Thomson
Recurse through all directories executing the supplied function
1.0K 次下载
更新 2008/7/22

查看许可证

Recurses through each directory, passing the full directory path and any extraneous arguments (varargin) to the specified function.

Call Sequence : directoryRecurse(directory, function_pointer, varargin)

IE: To execute the 'rmdir' command with the 's' parameter over 'c:\tmp' and all subdirectories:

directoryRecurse('c:\tmp', @rmdir, 's');

Another useful example, add 'c:\matlab' and all sub directories to the Matlab path:
directoryRecurse('c:\tmp', @addpath);

引用格式

Rodney Thomson (2026). Recursive Directory Function Execution (https://ww2.mathworks.cn/matlabcentral/fileexchange/20814-recursive-directory-function-execution), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14SP2
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Search Path 的更多信息
版本 已发布 发行说明
1.0.0.0