How do I rename a file programmatically in MATLAB 7.10 (R2010a)?

57 views (last 30 days)
I need to rename a file in my current folder from MATLAB, but the RENAME function works only with FTP server.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Jan 2012
You can rename a file programmatically from MATLAB using the MOVEFILE function. As an example, to rename "myfunction.m" to "oldfunction.m" in the current folder, you can use the following command:
movefile('myfunction.m','oldfunction.m');

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!