rename file using matlab command
matlab
Solution
Check the documentation:
Renaming a File in the Current Folder In the current folder, rename myfunction.m to oldfunction.m: movefile('myfunction.m','oldfunction.m')
Thus:
o=pwd
cd('folder')
movefile('toto.txt','toto2.txt.sav')
cd(o);
Problem
``` file1 = fullfile(pwd,'folder','toto.txt'); file2 = fullfile(pwd,'folder','toto2.txt.sav'); movefile(file1,file2) ``` =>this creates a folder named toto2.txt.sav whereas I'm looking for renaming the file in the same directory any idea ?