moving files sysntax

조회 수: 2 (최근 30일)
Baba
Baba 2011년 11월 7일
I would like to move files that start with data- to a folder called data that is in the same directory as the files:
mkdir ('data');
movefile('data-*','data')
having problems with the syntax of the destination folder
  댓글 수: 1
David Young
David Young 2011년 11월 7일
What is the nature of the problem? I can't see anything wrong.

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

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 7일
Your code should work. The only thing is that you need to run the code in the same folder where those data-* files are resident in because you didn't specify the full path. In other words, your MATLAB current folder needs to be that folder.
  댓글 수: 4
David Young
David Young 2011년 11월 8일
I tried the code too, and it worked fine.
Hastiepen
Hastiepen 2012년 6월 28일
movefile() will fail if MATLAB doesn't have permission to access the file. For example, after opening a text file in MATLAB to read it, then closing said text file, I found that I could not manually delete the file myself without restarting MATLAB.
A bit of a late answer, I know, but I hope this helps other people!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by