copyfile
Copy a file to a new location.
Syntax
Section titled “Syntax”copyfile(source, destination)copyfile(source, destination, 'f')[status, message, messageid] = copyfile(...)Description
Section titled “Description”Copies the file or directory source to destination. The third-argument string 'f' forces overwrite even if the destination exists and is read-only. Three-output form returns status (logical success), message (error text on failure), and messageid (error category).
Examples
Section titled “Examples”copyfile('data.csv', 'backup/data.csv')[ok, msg] = copyfile(src, dst, 'f');