フィルターのクリア

Error while copying, wrong argument

11 ビュー (過去 30 日間)
Nik Rocky
Nik Rocky 2020 年 7 月 2 日
コメント済み: Nik Rocky 2020 年 7 月 2 日
Hello,
I copy (with rename) a files:
inputFullFileName = fullfile(FilePath, FileName);
outputFullFileName = fullfile(test, NewFileName);
copyfile(inputFullFileName,outputFullFileName);
inputFullFileName =
'/home/user/workspace/QT/Software_2.0_QT/TEST/001_M1_Distance_0.5_AKG_C1000S_F1_MS2/001_M1_Distance_0.5_AKG_C1000S_F1_MS2.mat'
outputFullFileName =
1×1 cell array
{'/home/user/workspace/QT/Software_2.0_QT/TEST_SORT/Dist_1/AKG/Scenery_1/001_M1_Distance_0.5m_AKG_C1000S_F1_MS2.mat'}
i get error:
Error using copyfile
Argument must be a string scalar or character vector.
Error in Result_mover (line 94)
copyfile(inputFullFileName,outputFullFileName);
Try allready to change cell to string:
outputFullFileName = string(outputFullFileName);
But still a error. that is wrong

採用された回答

Walter Roberson
Walter Roberson 2020 年 7 月 2 日
copyfile(inputFullFileName,outputFullFileName{1});
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 2 日
You ended up with a cell array of character vectors. The {1} pulls out the first entry of that array.
outputFullFileName = fullfile(test, NewFileName);
either test or NewFileName was a cell array of character vector, but you did not happen to post enough code before that for me to see why you ended up with a cell array instead of a plain character vector.
Nik Rocky
Nik Rocky 2020 年 7 月 2 日
Okay, I understand! Thanky very much.
I love MATLAB community. So much help and education, and no angry people that still say: "go looking in google" =)
Best,
Nik

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by