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

I need to rename a file in my current folder from MATLAB, but the RENAME function works only with FTP server.

 Accepted Answer

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

Products

Community Treasure Hunt

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

Start Hunting!