copyfile
Copies all the files in a directory and all of its subdirectories and places the results in a new folder.
% [list,numfiles] = copyfile(ext,copypath,pastepath);
% written by Joseph Hollmann, April 2011
% created to copy all files of a given type from one directory and all of its
% subdirectories. Places all files in a new directory
% Input:
% ext - file extension to be copied (i.e. 'm' for m-files)
% pathname - directory to be searched
% Outputs:
% list - all the filenames with srchwrd
% numfiles - number of files in list
% persistent copypath pastepath; % allows the same path to be utilized several times
% copypath - path files exist
% pastepath - path to copy files to
Cite As
Joseph Hollmann (2026). copyfile (https://www.mathworks.com/matlabcentral/fileexchange/39182-copyfile), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
