MATLAB: How to rename a file programmatically in MATLAB 7.10 (R2010a)

codecommandfunctionlineMATLABmovefileprogrammatically

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

Best 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');
Related Question