variable format issue using copyfile
이전 댓글 표시
Hello Matlab community!
I am having what is probably a really simple issue using copyfile that I can't seem to debugg so hoping someone can help.
I am simply trying to copy an image file from one folder to another using specific paths. The code is here:
finalImgStr = (['RUN0',sprintf('%d',i), '_plot_0020.jpg']);
outputDir = ([projfilepath, '\Output\Run', sprintf('%d',i)]);
finalImg = fullfile(outputDir, finalImgStr);
finalImg1 = convertCharsToStrings(finalImg);
destDir1 = convertCharsToStrings(destDir);
copyfile ('finalImg1', 'destDir1');
When I try and run it I get an error saying 'no matching files were found'. However I have checked all the variables and the file paths are correct, and the image is in the source directory etc.
The variables were initially character arrays hence I have converted them to string array's (although the error is the same even if I leave them as characters...)
I'm assuming it's something to do with the formatting/data types but I can't work it out so any help would be appreciated!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!