Change directories within a loop
이전 댓글 표시
Currently my code looks like this
location='/pathtodata';
copyfile('location','./.')
It keeps trying to copy all folders named location into my directory, not folders from my previously defined location. I am using this in a loop so I want to be able to define the location of the data separately before putting it into my copy file code.
How do I get these files to copy?
댓글 수: 1
Walter Roberson
2016년 11월 10일
Could you confirm that you want to copy folders literally named 'location' ? If so, then what role does your variable that happens to be named location play here?
You want to do that multiple times in a loop? Are the previous location folder that was copied to be removed, or do you want to merge all of the contents into one big directory, or do you want to rename as you go so they end up with separate names like location_0001 location_0002 ?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!