copyfileを用​いたファイルのコピー​にstrcatを用い​る方法

複数のフォルダに同一ファイルをコピーしようと考え、以下のプログラムを作成したところ無効なオプションです。といったエラーが発生しました。 どのように修正をすれば、複数のフォルダを指定できるでしょうか。
select = 1; %0 HysOnebit 1 ditherOnebit 2 ditherHysOnebit 3 ditherHysCansOnebit 4 ditherCansOnebit
dither_value =[1/4 1/8 1/16 1/32 1/64];
gain = 0;
parfor i =1:length(dither_value)
now_dither = dither_value(1,i);
ditherfoldername = strcat('select','_',num2str(select),'_gain',num2str(gain),'_',num2str(now_dither));
copyfile ad* myFolder ditherfoldername
copyfile Onebit* myFolder ditherfoldername
copyfile input* myFolder ditherfoldername
end

 Risposta accettata

Walter Roberson
Walter Roberson il 13 Mag 2018

1 voto

copyfile('ad*', fullfile(myFolder, ditherfoldername));

2 Commenti

O.E
O.E il 15 Mag 2018
Thank you
masahiro yasuda
masahiro yasuda il 18 Lug 2021
Thank you. It helped me

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by