Rename file when using copyfiile

Hello, I would like to rename a file that I've just succesfully copied. The basic code is the following
filename = 'myfilename.dat'
source = fullfile('mysourcepath',filename)
destiantion = fullfile('mydestinationpath',filename)
copyfile(source,destination)

 Risposta accettata

madhan ravi
madhan ravi il 18 Nov 2018

0 voti

4 Commenti

Using
movefile('newfilename.dat','oldfilename.dat')
I'm getting the following error
Error using movefile
mv: cannon stat 'mydestinationpath/newfilename.dat': No such file or directory
movefile('myfilename.dat','Marisabel.dat')
% ^--your file renamed to --^
I also tried that and still got the error. However, I managed to rename it using copyfile again. Thanks anyway!
Anytime :)

Accedi per commentare.

Più risposte (0)

Categorie

Prodotti

Release

R2018b

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by