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

17 views (last 30 days)
O.E
O.E on 13 May 2018
Commented: masahiro yasuda on 18 Jul 2021
複数のフォルダに同一ファイルをコピーしようと考え、以下のプログラムを作成したところ無効なオプションです。といったエラーが発生しました。 どのように修正をすれば、複数のフォルダを指定できるでしょうか。
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

Accepted Answer

Walter Roberson
Walter Roberson on 13 May 2018
copyfile('ad*', fullfile(myFolder, ditherfoldername));
  2 Comments
O.E
O.E on 15 May 2018
Thank you
masahiro yasuda
masahiro yasuda on 18 Jul 2021
Thank you. It helped me

Sign in to comment.

More Answers (0)

Categories

Find more on Embedded Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!