copyfile error 'No matching files were found'

6 ビュー (過去 30 日間)
Joe_Z
Joe_Z 2019 年 8 月 29 日
コメント済み: Walter Roberson 2019 年 8 月 30 日
I am having a problem with copyfile giving the error 'no matching files were found'. I appreciate this is a commonly asked question but I just can't seem to find an answer that works for my code
The code is:
pathin =['D:\data'];
pathout =['D:\VB_data\stc'];
subjects = ["example1" "example2" "example3"];
for subj = subjects
source= strcat(pathin,'/',subj,'/',subj,'/','*RS_HF','/*.dcm')
target=strcat(pathout,'/', subj)
copyfile(source, target)
end
The paths are correct, with dir(source) giving the list of files I want to copy and exist(target) > 0.
Thanks
  2 件のコメント
Jos (10584)
Jos (10584) 2019 年 8 月 30 日
You appear to mix / and \ symbols to create a path ...
I suggest you use FULLFILE rather than strcat to concatenate folders into a full path to a file.
Walter Roberson
Walter Roberson 2019 年 8 月 30 日
Is subjects a string array or is it a cell array of character vectors? If it is a cell array then you would be building a cell array and copyfile cannot handle a cell array.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by