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)

 채택된 답변

madhan ravi
madhan ravi 2018년 11월 18일

0 개 추천

댓글 수: 4

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 --^
Marisabel Gonzalez
Marisabel Gonzalez 2018년 11월 18일
I also tried that and still got the error. However, I managed to rename it using copyfile again. Thanks anyway!
madhan ravi
madhan ravi 2018년 11월 18일
Anytime :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2018년 11월 18일

댓글:

2018년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by